org.ccsds.moims.mo.mal.structures.ObjectIdentity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-mal Show documentation
Show all versions of api-mal Show documentation
An implementation of the Java API for the CCSDS MAL
package org.ccsds.moims.mo.mal.structures;
/**
* The ObjectIdentity structure represents the object identity of an MO Object.
*/
public final class ObjectIdentity implements org.ccsds.moims.mo.mal.structures.Composite {
/**
* Short form for type.
*/
public static final Integer TYPE_SHORT_FORM = 1008;
/**
* 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(1);
/**
* 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 = 281474993488880L;
private static final long serialVersionUID = 281474993488880L;
/**
* The domain of the MO Object being referenced.
*/
private org.ccsds.moims.mo.mal.structures.IdentifierList domainId;
/**
* The area of the MO Object being referenced.
*/
private org.ccsds.moims.mo.mal.structures.Identifier areaId;
/**
* The type of the MO Object being referenced.
*/
private org.ccsds.moims.mo.mal.structures.Identifier typeId;
/**
* The key of the MO Object being referenced.
*/
private org.ccsds.moims.mo.mal.structures.Identifier keyId;
/**
* The version of the MO Object being referenced.
*/
private org.ccsds.moims.mo.mal.structures.UInteger versionId;
/**
* Default constructor for ObjectIdentity.
*/
/**
*
*/
public ObjectIdentity() {
}
/**
* Constructor that initialises the values of the structure.
*
* @param domainId The domain of the MO Object being referenced.
* @param areaId The area of the MO Object being referenced.
* @param typeId The type of the MO Object being referenced.
* @param keyId The key of the MO Object being referenced.
* @param versionId The version of the MO Object being referenced.
*/
public ObjectIdentity(org.ccsds.moims.mo.mal.structures.IdentifierList domainId, org.ccsds.moims.mo.mal.structures.Identifier areaId, org.ccsds.moims.mo.mal.structures.Identifier typeId, org.ccsds.moims.mo.mal.structures.Identifier keyId, org.ccsds.moims.mo.mal.structures.UInteger versionId) {
this.domainId = domainId;
this.areaId = areaId;
this.typeId = typeId;
this.keyId = keyId;
this.versionId = versionId;
}
/**
* 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.mal.structures.ObjectIdentity();
}
/**
* Returns the field domainId.
*
* @return The field domainId.
*/
public org.ccsds.moims.mo.mal.structures.IdentifierList getDomainId() {
return domainId;
}
/**
* Sets the field domainId.
*
* @param __newValue __newValue The new value.
*/
public void setDomainId(org.ccsds.moims.mo.mal.structures.IdentifierList __newValue) {
domainId = __newValue;
}
/**
* Returns the field areaId.
*
* @return The field areaId.
*/
public org.ccsds.moims.mo.mal.structures.Identifier getAreaId() {
return areaId;
}
/**
* Sets the field areaId.
*
* @param __newValue __newValue The new value.
*/
public void setAreaId(org.ccsds.moims.mo.mal.structures.Identifier __newValue) {
areaId = __newValue;
}
/**
* Returns the field typeId.
*
* @return The field typeId.
*/
public org.ccsds.moims.mo.mal.structures.Identifier getTypeId() {
return typeId;
}
/**
* Sets the field typeId.
*
* @param __newValue __newValue The new value.
*/
public void setTypeId(org.ccsds.moims.mo.mal.structures.Identifier __newValue) {
typeId = __newValue;
}
/**
* Returns the field keyId.
*
* @return The field keyId.
*/
public org.ccsds.moims.mo.mal.structures.Identifier getKeyId() {
return keyId;
}
/**
* Sets the field keyId.
*
* @param __newValue __newValue The new value.
*/
public void setKeyId(org.ccsds.moims.mo.mal.structures.Identifier __newValue) {
keyId = __newValue;
}
/**
* Returns the field versionId.
*
* @return The field versionId.
*/
public org.ccsds.moims.mo.mal.structures.UInteger getVersionId() {
return versionId;
}
/**
* Sets the field versionId.
*
* @param __newValue __newValue The new value.
*/
public void setVersionId(org.ccsds.moims.mo.mal.structures.UInteger __newValue) {
versionId = __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 ObjectIdentity) {
ObjectIdentity other = (ObjectIdentity) obj;
if (domainId == null) {
if (other.domainId != null) {
return false;
}
} else {
if (! domainId.equals(other.domainId)) {
return false;
}
}
if (areaId == null) {
if (other.areaId != null) {
return false;
}
} else {
if (! areaId.equals(other.areaId)) {
return false;
}
}
if (typeId == null) {
if (other.typeId != null) {
return false;
}
} else {
if (! typeId.equals(other.typeId)) {
return false;
}
}
if (keyId == null) {
if (other.keyId != null) {
return false;
}
} else {
if (! keyId.equals(other.keyId)) {
return false;
}
}
if (versionId == null) {
if (other.versionId != null) {
return false;
}
} else {
if (! versionId.equals(other.versionId)) {
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 + (domainId != null ? domainId.hashCode() : 0);
hash = 83 * hash + (areaId != null ? areaId.hashCode() : 0);
hash = 83 * hash + (typeId != null ? typeId.hashCode() : 0);
hash = 83 * hash + (keyId != null ? keyId.hashCode() : 0);
hash = 83 * hash + (versionId != null ? versionId.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("domainId=");
buf.append(domainId);
buf.append(", areaId=");
buf.append(areaId);
buf.append(", typeId=");
buf.append(typeId);
buf.append(", keyId=");
buf.append(keyId);
buf.append(", versionId=");
buf.append(versionId);
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.encodeElement(domainId);
encoder.encodeIdentifier(areaId);
encoder.encodeIdentifier(typeId);
encoder.encodeIdentifier(keyId);
encoder.encodeUInteger(versionId);
}
/**
* 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 {
domainId = (org.ccsds.moims.mo.mal.structures.IdentifierList) decoder.decodeElement(new org.ccsds.moims.mo.mal.structures.IdentifierList());
areaId = decoder.decodeIdentifier();
typeId = decoder.decodeIdentifier();
keyId = decoder.decodeIdentifier();
versionId = decoder.decodeUInteger();
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;
}
}