org.ccsds.moims.mo.com.structures.ObjectDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of API_COM Show documentation
Show all versions of API_COM Show documentation
The CCSDS COM API for Java
package org.ccsds.moims.mo.com.structures;
/**
* The ObjectDetails type is used to hold the extra information associated with an object instance, namely the related and source links.
*/
public final class ObjectDetails implements org.ccsds.moims.mo.mal.structures.Composite
{
/**
* Short form for type.
*/
public static final Integer TYPE_SHORT_FORM = Integer.valueOf(4);
/**
* Short form for area.
*/
public static final org.ccsds.moims.mo.mal.structures.UShort AREA_SHORT_FORM = new org.ccsds.moims.mo.mal.structures.UShort(2);
/**
* Version for area.
*/
public static final org.ccsds.moims.mo.mal.structures.UOctet AREA_VERSION = new org.ccsds.moims.mo.mal.structures.UOctet((short)1);
/**
* Short form for service.
*/
public static final org.ccsds.moims.mo.mal.structures.UShort SERVICE_SHORT_FORM = new org.ccsds.moims.mo.mal.structures.UShort(0);
/**
* Absolute short form for type.
*/
public static final Long SHORT_FORM = Long.valueOf(562949970198532L);
private static final long serialVersionUID = 562949970198532L;
/**
* Contains the object instance identifier of a related object (e.g. the ActionDefinition that an Action uses). This is service specific. The ObjectType of the related object is specified in the service specification. The related object must exist in the same domain as this object.
*/
private Long related;
/**
* An object which is at the origin of the object creation (e.g. the procedure from which an action was triggered).
*/
private org.ccsds.moims.mo.com.structures.ObjectId source;
/**
* Default constructor for ObjectDetails.
*/
public ObjectDetails()
{
}
/**
* Constructor that initialises the values of the structure.
* @param related Contains the object instance identifier of a related object (e.g. the ActionDefinition that an Action uses). This is service specific. The ObjectType of the related object is specified in the service specification. The related object must exist in the same domain as this object.
* @param source An object which is at the origin of the object creation (e.g. the procedure from which an action was triggered).
*/
public ObjectDetails(Long related, org.ccsds.moims.mo.com.structures.ObjectId source)
{
this.related = related;
this.source = source;
}
/**
* Creates an instance of this type using the default constructor. It is a generic factory method.
* @return A new instance of this type with default field values.
*/
public org.ccsds.moims.mo.mal.structures.Element createElement()
{
return new org.ccsds.moims.mo.com.structures.ObjectDetails();
}
/**
* Returns the field related.
* @return The field related.
*/
public Long getRelated()
{
return related;
}
/**
* Sets the field related.
* @param __newValue __newValue The new value.
*/
public void setRelated(Long __newValue)
{
related = __newValue;
}
/**
* Returns the field source.
* @return The field source.
*/
public org.ccsds.moims.mo.com.structures.ObjectId getSource()
{
return source;
}
/**
* Sets the field source.
* @param __newValue __newValue The new value.
*/
public void setSource(org.ccsds.moims.mo.com.structures.ObjectId __newValue)
{
source = __newValue;
}
/**
* Compares this object to the specified object. The result is true if and only if the argument is not null and is the same type that contains the same value as this object.
* @param obj obj the object to compare with.
* @return true if the objects are the same; false otherwise.
*/
public boolean equals(Object obj)
{
if (obj instanceof ObjectDetails)
{
ObjectDetails other = (ObjectDetails) obj;
if (related == null)
{
if (other.related != null)
{
return false;
}
}
else
{
if (! related.equals(other.related))
{
return false;
}
}
if (source == null)
{
if (other.source != null)
{
return false;
}
}
else
{
if (! source.equals(other.source))
{
return false;
}
}
return true;
}
return false;
}
/**
* Returns a hash code for this object.
* @return a hash code value for this object.
*/
public int hashCode()
{
int hash = 7;
hash = 83 * hash + (related != null ? related.hashCode() : 0);
hash = 83 * hash + (source != null ? source.hashCode() : 0);
return hash;
}
/**
* Returns a String object representing this type's value.
* @return a string representation of the value of this object.
*/
public String toString()
{
StringBuilder buf = new StringBuilder();
buf.append('(');
buf.append(",related=");
buf.append(related);
buf.append(",source=");
buf.append(source);
buf.append(')');
return buf.toString();
}
/**
* Encodes the value of this object using the provided MALEncoder.
* @param encoder encoder - the encoder to use for encoding.
* @throws org.ccsds.moims.mo.mal.MALException if any encoding errors are detected.
*/
public void encode(org.ccsds.moims.mo.mal.MALEncoder encoder) throws org.ccsds.moims.mo.mal.MALException
{
encoder.encodeNullableLong(related);
encoder.encodeNullableElement(source);
}
/**
* Decodes the value of this object using the provided MALDecoder.
* @param decoder decoder - the decoder to use for decoding.
* @return Returns this object.
* @throws org.ccsds.moims.mo.mal.MALException if any decoding errors are detected.
*/
public org.ccsds.moims.mo.mal.structures.Element decode(org.ccsds.moims.mo.mal.MALDecoder decoder) throws org.ccsds.moims.mo.mal.MALException
{
related = decoder.decodeNullableLong();
source = (org.ccsds.moims.mo.com.structures.ObjectId) decoder.decodeNullableElement(new org.ccsds.moims.mo.com.structures.ObjectId());
return this;
}
/**
* Returns the absolute short form of this type.
* @return The absolute short form of this type.
*/
public Long getShortForm()
{
return SHORT_FORM;
}
/**
* Returns the type short form of this type which is unique to the area/service it is defined in but not unique across all types.
* @return The type short form of this type.
*/
public Integer getTypeShortForm()
{
return TYPE_SHORT_FORM;
}
/**
* Returns the area number of this type.
* @return The area number of this type.
*/
public org.ccsds.moims.mo.mal.structures.UShort getAreaNumber()
{
return AREA_SHORT_FORM;
}
/**
* Returns the area version of this type.
* @return The area number of this type.
*/
public org.ccsds.moims.mo.mal.structures.UOctet getAreaVersion()
{
return AREA_VERSION;
}
/**
* Returns the service number of this type.
* @return The service number of this type.
*/
public org.ccsds.moims.mo.mal.structures.UShort getServiceNumber()
{
return SERVICE_SHORT_FORM;
}
}