All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.micromata.opengis.kml.v_2_2_0.NetworkLinkControl Maven / Gradle / Ivy

Go to download

This is JavaAPIforKMml, Micromata's library for use with applications that want to parse, generate and operate on KML. It is an implementation of the OGC KML 2.2 standard. It is written entirely in Java and makes heavy use of JAXB.

There is a newer version: 3.0.4
Show newest version

package de.micromata.opengis.kml.v_2_2_0;

import jakarta.xml.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


/**
 * {@code }
 * 

* Controls the behavior of files fetched by a NetworkLink. *

* * Syntax: *
<NetworkLinkControl>
 *   <minRefreshPeriod>0</minRefreshPeriod>           <!-- float -->
 *   <maxSessionLength>-1</maxSessionLength>          <!-- float --> 
 *   <cookie>...</cookie>                             <!-- string -->                             
 *   <message>...</message>                           <!-- string -->
 *   <linkName>...</linkName>                         <!-- string -->                          
 *   <linkDescription>...</linkDescription>           <!-- string -->              
 *   <linkSnippet maxLines="2">...</linkSnippet>      <!-- string -->                      
 *   <expires>...</expires>                           <!-- kml:dateTime -->
 *   <Update>...</Update>                             <!-- Change,Create,Delete -->
 *   <AbstractView>...</AbstractView>                 <!-- LookAt or Camera -->
 * </NetworkLinkControl>
* * See Also: * NetworkLink * Update * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NetworkLinkControlType", propOrder = { "minRefreshPeriod", "maxSessionLength", "cookie", "message", "linkName", "linkDescription", "linkSnippet", "expires", "update", "abstractView", "networkLinkControlSimpleExtension", "networkLinkControlObjectExtension" }) @XmlRootElement(name = "NetworkLinkControl", namespace = "http://www.opengis.net/kml/2.2") public class NetworkLinkControl implements Cloneable { /** * {@code } *

* Specified in seconds, {@code } is the minimum allowed time between fetches * of the file. This parameter allows servers to throttle fetches of a particular file * and to tailor refresh rates to the expected rate of change to the data. For example, * a user might set a link refresh to 5 seconds, but you could set your minimum refresh * period to 3600 to limit refresh updates to once every hour. *

* * * */ @XmlElement(defaultValue = "0.0") protected double minRefreshPeriod; /** * {@code } *

* Specified in seconds, {@code } is the maximum amount of time for which * the client NetworkLink can remain connected. The default value of -1 indicates not * to terminate the session explicitly. *

* * * */ @XmlElement(defaultValue = "-1.0") protected double maxSessionLength; /** * {@code } *

* Use this element to append a string to the URL query on the next refresh of the * network link. You can use this data in your script to provide more intelligent handling * on the server side, including version querying and conditional file delivery. *

* * * */ protected String cookie; /** * {@code } *

* You can deliver a pop-up message, such as usage guidelines for your network link. * The message appears when the network link is first loaded into Google Earth, or * when it is changed in the network link control. *

* * * */ protected String message; /** * {@code } *

* You can control the name of the network link from the server, so that changes made * to the name on the client side are overridden by the server. *

* * * */ protected String linkName; /** * {@code } *

* You can control the description of the network link from the server, so that changes * made to the description on the client side are overridden by the server. *

* * * */ protected String linkDescription; /** * {@code } *

* You can control the snippet for the network link from the server, so that changes * made to the snippet on the client side are overridden by the server. {@code } * has a maxLines attribute, an integer that specifies the maximum number of lines * to display. *

* * * */ protected Snippet linkSnippet; /** * {@code } *

* You can specify a date/time at which the link should be refreshed. This specification * takes effect only if the {@code } in {@code } has a value of onExpire. See {@code } *

* * * */ protected String expires; /** * {@code } *

* Specifies an addition, change, or deletion to KML data that has already been loaded * using the specified URL. The targetHref specifies the .kml or .kmz file whose * data (within Google Earth) is to be modified. Update is always contained in a * NetworkLinkControl. Furthermore, the file containing the NetworkLinkControl must * have been loaded by a NetworkLink. See the "Topics in KML" page on Updates for a * detailed example of how Update works. *

*

* With Update, you can specify any number of Change, Create, and Delete tags for * a .kml file or .kmz archive that has previously been loaded with a network link. * See Update. *

* * Syntax: *
<Update>
     *   <targetHref>...<targetHref>    <!-- URL -->
     *   <Change>...</Change>
     *   <Create>...</Create>
     *   <Delete>...</Delete>
     * </Update>
* * Contained By: * * * * * * */ @XmlElement(name = "Update") protected Update update; /** * {@code } *

* Defines a viewpoint associated with any element derived from Feature. See Camera * and LookAt. *

*

* This is an abstract element and cannot be used directly in a KML file. This element * is extended by the Camera and LookAt elements. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- AbstractView -->                   <!-- Camera, LookAt -->                
     *   <!-- extends Object -->
     *   <TimePrimitive>...</TimePrimitive>                        <!-- gx:TimeSpan or gx:TimeStamp -->
     * <-- /AbstractView -->
* * Extends: * * * Extended By: * * * * * */ @XmlElementRef(name = "AbstractViewGroup", namespace = "http://www.opengis.net/kml/2.2", required = false) protected AbstractView abstractView; @XmlElement(name = "NetworkLinkControlSimpleExtensionGroup") @XmlSchemaType(name = "anySimpleType") protected List networkLinkControlSimpleExtension; /** * {@code } *

* This is an abstract base class and cannot be used directly in a KML file. It provides * the id attribute, which allows unique identification of a KML element, and the targetId * attribute, which is used to reference objects that have already been loaded into * Google Earth. The id attribute must be assigned if the Update mechanism is to * be used. *

* * Syntax: *
<!-- abstract element; do not create -->
     * <!-- Object id="ID" targetId="NCName" -->
     * <!-- /Object> -->
* * * */ @XmlElement(name = "NetworkLinkControlObjectExtensionGroup") protected List networkLinkControlObjectExtension; public NetworkLinkControl() { super(); } /** * * * @return * possible object is * {@link Double} * */ public double getMinRefreshPeriod() { return minRefreshPeriod; } /** * * * @param value * allowed object is * {@link Double} * */ public void setMinRefreshPeriod(double value) { this.minRefreshPeriod = value; } /** * * * @return * possible object is * {@link Double} * */ public double getMaxSessionLength() { return maxSessionLength; } /** * * * @param value * allowed object is * {@link Double} * */ public void setMaxSessionLength(double value) { this.maxSessionLength = value; } /** * * * @return * possible object is * {@link String} * */ public String getCookie() { return cookie; } /** * * * @param value * allowed object is * {@link String} * */ public void setCookie(String value) { this.cookie = value; } /** * * * @return * possible object is * {@link String} * */ public String getMessage() { return message; } /** * * * @param value * allowed object is * {@link String} * */ public void setMessage(String value) { this.message = value; } /** * * * @return * possible object is * {@link String} * */ public String getLinkName() { return linkName; } /** * * * @param value * allowed object is * {@link String} * */ public void setLinkName(String value) { this.linkName = value; } /** * * * @return * possible object is * {@link String} * */ public String getLinkDescription() { return linkDescription; } /** * * * @param value * allowed object is * {@link String} * */ public void setLinkDescription(String value) { this.linkDescription = value; } /** * * * @return * possible object is * {@link Snippet} * */ public Snippet getLinkSnippet() { return linkSnippet; } /** * * * @param value * allowed object is * {@link Snippet} * */ public void setLinkSnippet(Snippet value) { this.linkSnippet = value; } /** * * * @return * possible object is * {@link String} * */ public String getExpires() { return expires; } /** * * * @param value * allowed object is * {@link String} * */ public void setExpires(String value) { this.expires = value; } /** * * * @return * possible object is * {@link Update} * */ public Update getUpdate() { return update; } /** * * * @param value * allowed object is * {@link Update} * */ public void setUpdate(Update value) { this.update = value; } /** * * * @return * possible object is * {@code <}{@link AbstractView}{@code >} * {@code <}{@link LookAt}{@code >} * {@code <}{@link Camera}{@code >} * */ public AbstractView getAbstractView() { return abstractView; } /** * * * @param value * allowed object is * {@code <}{@link AbstractView}{@code >} * {@code <}{@link LookAt}{@code >} * {@code <}{@link Camera}{@code >} * */ public void setAbstractView(AbstractView value) { this.abstractView = ((AbstractView ) value); } /** * * */ public List getNetworkLinkControlSimpleExtension() { if (networkLinkControlSimpleExtension == null) { networkLinkControlSimpleExtension = new ArrayList(); } return this.networkLinkControlSimpleExtension; } /** * * */ public List getNetworkLinkControlObjectExtension() { if (networkLinkControlObjectExtension == null) { networkLinkControlObjectExtension = new ArrayList(); } return this.networkLinkControlObjectExtension; } @Override public int hashCode() { final int prime = 31; int result = 1; long temp; temp = Double.doubleToLongBits(minRefreshPeriod); result = ((prime*result)+((int)(temp^(temp >>>(32))))); temp = Double.doubleToLongBits(maxSessionLength); result = ((prime*result)+((int)(temp^(temp >>>(32))))); result = ((prime*result)+((cookie == null)? 0 :cookie.hashCode())); result = ((prime*result)+((message == null)? 0 :message.hashCode())); result = ((prime*result)+((linkName == null)? 0 :linkName.hashCode())); result = ((prime*result)+((linkDescription == null)? 0 :linkDescription.hashCode())); result = ((prime*result)+((linkSnippet == null)? 0 :linkSnippet.hashCode())); result = ((prime*result)+((expires == null)? 0 :expires.hashCode())); result = ((prime*result)+((update == null)? 0 :update.hashCode())); result = ((prime*result)+((abstractView == null)? 0 :abstractView.hashCode())); result = ((prime*result)+((networkLinkControlSimpleExtension == null)? 0 :networkLinkControlSimpleExtension.hashCode())); result = ((prime*result)+((networkLinkControlObjectExtension == null)? 0 :networkLinkControlObjectExtension.hashCode())); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if ((obj instanceof NetworkLinkControl) == false) { return false; } NetworkLinkControl other = ((NetworkLinkControl) obj); if (minRefreshPeriod!= other.minRefreshPeriod) { return false; } if (maxSessionLength!= other.maxSessionLength) { return false; } if (cookie == null) { if (other.cookie!= null) { return false; } } else { if (cookie.equals(other.cookie) == false) { return false; } } if (message == null) { if (other.message!= null) { return false; } } else { if (message.equals(other.message) == false) { return false; } } if (linkName == null) { if (other.linkName!= null) { return false; } } else { if (linkName.equals(other.linkName) == false) { return false; } } if (linkDescription == null) { if (other.linkDescription!= null) { return false; } } else { if (linkDescription.equals(other.linkDescription) == false) { return false; } } if (linkSnippet == null) { if (other.linkSnippet!= null) { return false; } } else { if (linkSnippet.equals(other.linkSnippet) == false) { return false; } } if (expires == null) { if (other.expires!= null) { return false; } } else { if (expires.equals(other.expires) == false) { return false; } } if (update == null) { if (other.update!= null) { return false; } } else { if (update.equals(other.update) == false) { return false; } } if (abstractView == null) { if (other.abstractView!= null) { return false; } } else { if (abstractView.equals(other.abstractView) == false) { return false; } } if (networkLinkControlSimpleExtension == null) { if (other.networkLinkControlSimpleExtension!= null) { return false; } } else { if (networkLinkControlSimpleExtension.equals(other.networkLinkControlSimpleExtension) == false) { return false; } } if (networkLinkControlObjectExtension == null) { if (other.networkLinkControlObjectExtension!= null) { return false; } } else { if (networkLinkControlObjectExtension.equals(other.networkLinkControlObjectExtension) == false) { return false; } } return true; } /** * Creates a new instance of {@link Snippet} and set it to linkSnippet. * * This method is a short version for: * {@code * Snippet snippet = new Snippet(); * this.setLinkSnippet(snippet); } * * */ public Snippet createAndSetLinkSnippet() { Snippet newValue = new Snippet(); this.setLinkSnippet(newValue); return newValue; } /** * Creates a new instance of {@link Update} and set it to update. * * This method is a short version for: * {@code * Update update = new Update(); * this.setUpdate(update); } * * * @param createOrDeleteOrChange * required parameter * @param targetHref * required parameter */ public Update createAndSetUpdate(final String targetHref, final List createOrDeleteOrChange) { Update newValue = new Update(targetHref, createOrDeleteOrChange); this.setUpdate(newValue); return newValue; } /** * Creates a new instance of {@link LookAt} and set it to abstractView. * * This method is a short version for: * {@code * LookAt lookAt = new LookAt(); * this.setAbstractView(lookAt); } * * */ public LookAt createAndSetLookAt() { LookAt newValue = new LookAt(); this.setAbstractView(newValue); return newValue; } /** * Creates a new instance of {@link Camera} and set it to abstractView. * * This method is a short version for: * {@code * Camera camera = new Camera(); * this.setAbstractView(camera); } * * */ public Camera createAndSetCamera() { Camera newValue = new Camera(); this.setAbstractView(newValue); return newValue; } /** * * * @param networkLinkControlSimpleExtension * Objects of the following type are allowed in the list: {@link Object} */ public void setNetworkLinkControlSimpleExtension(final List networkLinkControlSimpleExtension) { this.networkLinkControlSimpleExtension = networkLinkControlSimpleExtension; } /** * add a value to the networkLinkControlSimpleExtension property collection * * @param networkLinkControlSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * true (as general contract of Collection.add). */ public NetworkLinkControl addToNetworkLinkControlSimpleExtension(final Object networkLinkControlSimpleExtension) { this.getNetworkLinkControlSimpleExtension().add(networkLinkControlSimpleExtension); return this; } /** * * * @param networkLinkControlObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} */ public void setNetworkLinkControlObjectExtension(final List networkLinkControlObjectExtension) { this.networkLinkControlObjectExtension = networkLinkControlObjectExtension; } /** * add a value to the networkLinkControlObjectExtension property collection * * @param networkLinkControlObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * true (as general contract of Collection.add). */ public NetworkLinkControl addToNetworkLinkControlObjectExtension(final AbstractObject networkLinkControlObjectExtension) { this.getNetworkLinkControlObjectExtension().add(networkLinkControlObjectExtension); return this; } /** * fluent setter * * * @param minRefreshPeriod * required parameter */ public NetworkLinkControl withMinRefreshPeriod(final double minRefreshPeriod) { this.setMinRefreshPeriod(minRefreshPeriod); return this; } /** * fluent setter * * * @param maxSessionLength * required parameter */ public NetworkLinkControl withMaxSessionLength(final double maxSessionLength) { this.setMaxSessionLength(maxSessionLength); return this; } /** * fluent setter * * * @param cookie * required parameter */ public NetworkLinkControl withCookie(final String cookie) { this.setCookie(cookie); return this; } /** * fluent setter * * * @param message * required parameter */ public NetworkLinkControl withMessage(final String message) { this.setMessage(message); return this; } /** * fluent setter * * * @param linkName * required parameter */ public NetworkLinkControl withLinkName(final String linkName) { this.setLinkName(linkName); return this; } /** * fluent setter * * * @param linkDescription * required parameter */ public NetworkLinkControl withLinkDescription(final String linkDescription) { this.setLinkDescription(linkDescription); return this; } /** * fluent setter * * * @param linkSnippet * required parameter */ public NetworkLinkControl withLinkSnippet(final Snippet linkSnippet) { this.setLinkSnippet(linkSnippet); return this; } /** * fluent setter * * * @param expires * required parameter */ public NetworkLinkControl withExpires(final String expires) { this.setExpires(expires); return this; } /** * fluent setter * * * @param update * required parameter */ public NetworkLinkControl withUpdate(final Update update) { this.setUpdate(update); return this; } /** * fluent setter * * * @param abstractView * required parameter */ public NetworkLinkControl withAbstractView(final AbstractView abstractView) { this.setAbstractView(abstractView); return this; } /** * fluent setter * * * @param networkLinkControlSimpleExtension * required parameter */ public NetworkLinkControl withNetworkLinkControlSimpleExtension(final List networkLinkControlSimpleExtension) { this.setNetworkLinkControlSimpleExtension(networkLinkControlSimpleExtension); return this; } /** * fluent setter * * * @param networkLinkControlObjectExtension * required parameter */ public NetworkLinkControl withNetworkLinkControlObjectExtension(final List networkLinkControlObjectExtension) { this.setNetworkLinkControlObjectExtension(networkLinkControlObjectExtension); return this; } @Override public NetworkLinkControl clone() { NetworkLinkControl copy; try { copy = ((NetworkLinkControl) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.linkSnippet = ((linkSnippet == null)?null:((Snippet) linkSnippet.clone())); copy.update = ((update == null)?null:((Update) update.clone())); copy.abstractView = ((abstractView == null)?null:((AbstractView ) abstractView.clone())); copy.networkLinkControlSimpleExtension = new ArrayList((getNetworkLinkControlSimpleExtension().size())); for (Object iter: networkLinkControlSimpleExtension) { copy.networkLinkControlSimpleExtension.add(iter); } copy.networkLinkControlObjectExtension = new ArrayList((getNetworkLinkControlObjectExtension().size())); for (AbstractObject iter: networkLinkControlObjectExtension) { copy.networkLinkControlObjectExtension.add(iter.clone()); } return copy; } }