001
002/*
003 * Copyright (C) 2010 Archie L. Cobbs. All rights reserved.
004 *
005 * $Id$
006 */
007
008package org.dellroad.jibxbindings.pidf.lo;
009
010import org.dellroad.jibxbindings.pidf.LangContent;
011
012/**
013 * The {@code <gp:geopriv>} element as defined in RFC 4119.
014 */
015public class GeoPriv implements Cloneable {
016
017    private LocationInfo locationInfo;
018    private UsageRules usageRules;
019    private LangContent method;
020    private ProvidedBy providedBy;
021
022    public LocationInfo getLocationInfo() {
023        return this.locationInfo;
024    }
025    public void setLocationInfo(LocationInfo locationInfo) {
026        this.locationInfo = locationInfo;
027    }
028
029    public UsageRules getUsageRules() {
030        return this.usageRules;
031    }
032    public void setUsageRules(UsageRules usageRules) {
033        this.usageRules = usageRules;
034    }
035
036    public LangContent getMethod() {
037        return this.method;
038    }
039    public void setMethod(LangContent method) {
040        this.method = method;
041    }
042
043    public ProvidedBy getProvidedBy() {
044        return this.providedBy;
045    }
046    public void setProvidedBy(ProvidedBy providedBy) {
047        this.providedBy = providedBy;
048    }
049
050// Cloneable
051
052    @Override
053    public GeoPriv clone() {
054        final GeoPriv clone;
055        try {
056            clone = (GeoPriv)super.clone();
057        } catch (CloneNotSupportedException e) {
058            throw new RuntimeException(e);
059        }
060        clone.locationInfo = this.locationInfo != null ? this.locationInfo.clone() : null;
061        clone.usageRules = this.usageRules != null ? this.usageRules.clone() : null;
062        clone.method = this.method != null ? this.method.clone() : null;
063        clone.providedBy = this.providedBy != null ? this.providedBy.clone() : null;
064        return clone;
065    }
066}
067