org.ccsds.moims.mo.common.directory.structures.ProviderSummary Maven / Gradle / Ivy
package org.ccsds.moims.mo.common.directory.structures;
/**
* The ProviderSummary structure holds information about a provider of a service
* and its capabilities.
*/
public final class ProviderSummary implements org.ccsds.moims.mo.mal.structures.Composite {
/**
* Short form for type.
*/
@Deprecated
private static final Integer TYPE_SHORT_FORM = 5;
/**
* Absolute short form for type. This will be replaced by the TypeId.
*/
@Deprecated
public static final Long SHORT_FORM = 844429241876485L;
private static final long serialVersionUID = 844429241876485L;
/**
* Absolute short form for type.
*/
public static final org.ccsds.moims.mo.mal.TypeId TYPE_ID = new org.ccsds.moims.mo.mal.TypeId(SHORT_FORM);
/**
* The COM object key of this service provider.
*/
private org.ccsds.moims.mo.com.structures.ObjectKey providerKey;
/**
* The id of this service provider.
*/
private org.ccsds.moims.mo.mal.structures.Identifier providerId;
/**
* The service capabilities supported by this provider.
*/
private org.ccsds.moims.mo.common.directory.structures.ProviderDetails providerDetails;
/**
* Default constructor for ProviderSummary.
*
*/
public ProviderSummary() {
}
/**
* Constructor that initialises the values of the structure.
*
* @param providerKey The COM object key of this service provider.
* @param providerId The id of this service provider.
* @param providerDetails The service capabilities supported by this provider.
*/
public ProviderSummary(org.ccsds.moims.mo.com.structures.ObjectKey providerKey,
org.ccsds.moims.mo.mal.structures.Identifier providerId,
org.ccsds.moims.mo.common.directory.structures.ProviderDetails providerDetails) {
this.providerKey = providerKey;
this.providerId = providerId;
this.providerDetails = providerDetails;
}
/**
* 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.common.directory.structures.ProviderSummary();
}
/**
* Returns the field providerKey.
*
* @return The field providerKey.
*/
public org.ccsds.moims.mo.com.structures.ObjectKey getProviderKey() {
return providerKey;
}
/**
* Sets the field providerKey.
*
* @param __newValue The new value.
*/
@Deprecated
public void setProviderKey(org.ccsds.moims.mo.com.structures.ObjectKey __newValue) {
providerKey = __newValue;
}
/**
* Returns the field providerId.
*
* @return The field providerId.
*/
public org.ccsds.moims.mo.mal.structures.Identifier getProviderId() {
return providerId;
}
/**
* Sets the field providerId.
*
* @param __newValue The new value.
*/
@Deprecated
public void setProviderId(org.ccsds.moims.mo.mal.structures.Identifier __newValue) {
providerId = __newValue;
}
/**
* Returns the field providerDetails.
*
* @return The field providerDetails.
*/
public org.ccsds.moims.mo.common.directory.structures.ProviderDetails getProviderDetails() {
return providerDetails;
}
/**
* Sets the field providerDetails.
*
* @param __newValue The new value.
*/
@Deprecated
public void setProviderDetails(org.ccsds.moims.mo.common.directory.structures.ProviderDetails __newValue) {
providerDetails = __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 The object to compare with.
* @return true if the objects are the same; false otherwise.
*/
public boolean equals(Object obj) {
if (obj instanceof ProviderSummary) {
ProviderSummary other = (ProviderSummary) obj;
if (providerKey == null) {
if (other.providerKey != null) {
return false;
}
} else {
if (! providerKey.equals(other.providerKey)) {
return false;
}
}
if (providerId == null) {
if (other.providerId != null) {
return false;
}
} else {
if (! providerId.equals(other.providerId)) {
return false;
}
}
if (providerDetails == null) {
if (other.providerDetails != null) {
return false;
}
} else {
if (! providerDetails.equals(other.providerDetails)) {
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 + (providerKey != null ? providerKey.hashCode() : 0);
hash = 83 * hash + (providerId != null ? providerId.hashCode() : 0);
hash = 83 * hash + (providerDetails != null ? providerDetails.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("(ProviderSummary: ");
buf.append("providerKey=");
buf.append(providerKey);
buf.append(", providerId=");
buf.append(providerId);
buf.append(", providerDetails=");
buf.append(providerDetails);
buf.append(')');
return buf.toString();
}
/**
* Encodes the value of this object using the provided MALEncoder.
*
* @param 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 {
if (providerKey == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'providerKey' cannot be null!");
}
if (providerId == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'providerId' cannot be null!");
}
if (providerDetails == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'providerDetails' cannot be null!");
}
encoder.encodeElement(providerKey);
encoder.encodeIdentifier(providerId);
encoder.encodeElement(providerDetails);
}
/**
* Decodes the value of this object using the provided MALDecoder.
*
* @param 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 {
providerKey = (org.ccsds.moims.mo.com.structures.ObjectKey) decoder.decodeElement(new org.ccsds.moims.mo.com.structures.ObjectKey());
providerId = decoder.decodeIdentifier();
providerDetails = (org.ccsds.moims.mo.common.directory.structures.ProviderDetails) decoder.decodeElement(new org.ccsds.moims.mo.common.directory.structures.ProviderDetails());
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 org.ccsds.moims.mo.common.CommonHelper.COMMON_AREA_NUMBER;
}
/**
* Returns the area version of this type.
*
* @return The area number of this type.
*/
public org.ccsds.moims.mo.mal.structures.UOctet getAreaVersion() {
return org.ccsds.moims.mo.common.CommonHelper.COMMON_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 org.ccsds.moims.mo.common.directory.DirectoryServiceInfo.DIRECTORY_SERVICE_NUMBER;
}
/**
* Returns the TypeId of this element.
*
* @return The TypeId of this element.
*/
public org.ccsds.moims.mo.mal.TypeId getTypeId() {
return TYPE_ID;
}
}