Class NamedInteger
- java.lang.Object
-
- java.lang.Number
-
- com.opencloud.util.NamedInteger
-
- All Implemented Interfaces:
DataObject
,Immutable
,Serializable
- Direct Known Subclasses:
AddressString.Nature
,AddressString.SMSNature
,BearerCapability.ITU_T.Ericsson.Configuration
,BearerCapability.ITU_T.Ericsson.Ericsson4b.EncodedValue
,BearerCapability.ITU_T.Ericsson.Ericsson4b.Symmetry
,BearerCapability.ITU_T.Ericsson.Establishment
,BearerCapability.ITU_T.Ericsson.Structure
,BearerCapability.ITU_T.Layer1Capability.Details.ParityAndModem.Modem.EncodedValue
,BearerCapability.ITU_T.Layer1Capability.Details.ParityAndModem.Modem.ModemType
,BearerCapability.ITU_T.Layer1Capability.Details.ParityAndModem.NumberOfDataBits
,BearerCapability.ITU_T.Layer1Capability.Details.ParityAndModem.NumberOfStopBits
,BearerCapability.ITU_T.Layer1Capability.Details.ParityAndModem.Parity
,BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.EncodedValue
,BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.EncodedValue
,BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V110.IntermediateRate
,BearerCapability.ITU_T.Layer1Capability.Details.UnrestrictedDigital.V120.EncodedValue
,BearerCapability.ITU_T.Layer1Capability.Details.UserRate
,BearerCapability.ITU_T.Layer1Capability.Layer1Protocol
,BearerCapability.ITU_T.Layer2Protocol
,BearerCapability.ITU_T.Layer3Capability.Layer3Protocol
,BearerCapability.ITU_T.Layer3Capability.Layer3ProtocolId
,BearerCapability.ITU_T.TransferCapability
,BearerCapability.ITU_T.TransferMode
,BearerCapability.ITU_T.TransferRate
,BitStringWithNamedBits.NamedBit
,CalledPartyNumber.Nature
,CallingPartyNumber.Nature
,CallingPartysCategory.Category
,CAP2CAMEL_AChBillingChargingCharacteristics.Choice
,CAP2CAMEL_CallResult.Choice
,CAP2CAMEL_FCIBillingChargingCharacteristics.Choice
,CAP2CAMEL_SCIBillingChargingCharacteristics.Choice
,CAP2DPSpecificCriteria.Choice
,CAP3EventSpecificInformationSMS.Choice
,CAP3EventTypeSMS
,CAP3GPRSEventType
,Cause.CauseValue
,Cause.Recommendation
,CCBasicGapCriteria.Choice
,CCBearerCapability.Choice
,CCCancelArg.Choice
,CCCollectedInfo.Choice
,CCConnectToResourceArg.ResourceAddress.Choice
,CCControlType
,CCEventSpecificInformationBCSM.Choice
,CCEventTypeBCSM
,CCFurnishChargingInformationArg.Choice
,CCGapCriteria.Choice
,CCGapTreatment.Choice
,CCInformationToSend.Choice
,CCLegID.Choice
,CCMiscCallInfo.MessageType
,CCReceivedInformationArg.Choice
,CCReleaseCallArg.Choice
,CCRequestedInformationType
,CCRequestedInformationValue.Choice
,CCSpecializedResourceReportArg.Choice
,CCVariablePart.Choice
,Cksn.EncodedValue
,CS1CGEncountered
,CS1DPSpecificCriteria.Choice
,ForwardCallIndicators.EndToEndMethod
,ForwardCallIndicators.ISDNUserPartPreference
,GenericDigits.EncodingScheme
,GenericDigits.TypeOfDigits
,GenericNumber.Nature
,GenericNumber.NumberQualifier
,HighLayerCompatibility.Characteristics
,HighLayerCompatibility.CodingStandard
,HighLayerCompatibility.Interpretation
,HighLayerCompatibility.Presentation
,LegType.EncodedValue
,LocationNumber.Nature
,MAPAbsentSubscriberReason
,MAPAccessNetworkProtocolId
,MAPAccessType
,MAPAccuracyFulfilmentIndicator
,MAPAdditionalNetworkResource
,MAPAdditionalRequestedCAMEL_SubscriptionInfo
,MAPAdditionalRoamingNotAllowedCause
,MAPAreaType
,MAPBasicServiceCode.Choice
,MAPCallOutcome
,MAPCallTerminationIndicator
,MAPCancellationType
,MAPCCBS_SubscriberStatus
,MAPDefaultCallHandling
,MAPDefaultGPRS_Handling
,MAPDefaultSMS_Handling
,MAPDomainType
,MAPExt_ProtocolId
,MAPFailureCauseParam
,MAPForwardAccessSignalling_Arg.Choice
,MAPGMLC_Restriction
,MAPGPRS_TriggerDetectionPoint
,MAPGroupRequestedInfo
,MAPInterrogateSSRes_v1.Choice
,MAPIST_SupportIndicator
,MAPKeyStatus
,MAPLCS_Event
,MAPLCS_FormatIndicator
,MAPLCSClientInternalID
,MAPLCSClientType
,MAPLocationEstimateType
,MAPMonitoringMode
,MAPMT_SMS_TPDU_Type
,MAPNetworkAccessMode
,MAPNotificationToMSUser
,MAPNumberPortabilityStatus
,MAPO_BcsmTriggerDetectionPoint
,MAPOccurrenceInfo
,MAPPositionMethodFailure_Diagnostic
,MAPPrepareSubsequentHO_Res.Choice
,MAPPrivacyCheckRelatedAction
,MAPProcessAccessSignalling_Arg.Choice
,MAPRAN_Technology
,MAPReportingState
,MAPRequestingNodeType
,MAPResponseTimeCategory
,MAPRUF_Outcome
,MAPSendAuthenticationInfoRes.Choice
,MAPSendEndSignal_Arg.Choice
,MAPSM_DeliveryNotIntended
,MAPSM_RP_DA_v1.Choice
,MAPSMS_TriggerDetectionPoint
,MAPSS_Information.Choice
,MAPSS_SubscriptionOption_v1.Choice
,MAPT_BcsmTriggerDetectionPoint
,MAPTerminationCause
,MAPTraceDepth
,MAPTypeOfUpdate
,MAPUnauthorizedLCSClient_Diagnostic
,MAPUnavailabilityCause
,MAPUnknownSubscriberDiagnostic
,MAPUsed_RAT_Type
,MMCode.EncodedValue
,MSBearerCapability.GSM.Content.NonSpeech.Access.O5a.OtherITC
,MSBearerCapability.GSM.Content.NonSpeech.Access.O5a.OtherRateAdaption
,MSBearerCapability.GSM.Content.NonSpeech.Access.SignallingAccessProtocol
,MSBearerCapability.GSM.Content.NonSpeech.DataProtocol.Configuration
,MSBearerCapability.GSM.Content.NonSpeech.DataProtocol.Establishment
,MSBearerCapability.GSM.Content.NonSpeech.DataProtocol.NIRR
,MSBearerCapability.GSM.Content.NonSpeech.DataProtocol.Structure
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.Layer1Protocol
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.Negotiation
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.IntermediateRate
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.O6c.ModemType
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.O6c.O6d.FixedUserRate
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.O6c.O6d.O6e.O6f.O6g.AsymmetryIndication
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.O6c.O6d.O6e.O6f.UIMI
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.O6c.O6d.O6e.O6f.WantedAirInterface
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.O6c.O6d.OtherModemType
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.O6b.Parity
,MSBearerCapability.GSM.Content.NonSpeech.Layer1Capability.O6a.UserRate
,MSBearerCapability.GSM.Content.NonSpeech.Layer2Protocol
,MSBearerCapability.GSM.Content.NonSpeech.TransferCapability
,MSBearerCapability.GSM.Content.Speech.SpeechVersion
,MSBearerCapability.GSM.RadioChannelReq
,MSClassmark.MSClassmark1.RevisionLevel
,MSClassmark.MSClassmark1.RFPowerCapability
,MSClassmark.MSClassmark2.RevisionLevel
,MSClassmark.MSClassmark2.RFPowerCapability
,MSClassmark.MSClassmark2.SSScreeningIndicator
,OpenId.Choice
,OriginalCalledNumber.Nature
,RedirectingPartyNumber.Nature
,RedirectionInformation.OriginalReason
,RedirectionInformation.Redirecting
,RedirectionInformation.RedirectingReason
,RejectProblem.GeneralProblem
,RejectProblem.InvokeProblem
,RejectProblem.ReturnErrorProblem
,RejectProblem.ReturnResultProblem
,RejectProblem.TransactionProblem
,RPCause.CauseValue
,Signal.SignalValue
,SMSAddress.Nature
,SMSDataCodingScheme.EncodedValue
,SMSDataCodingScheme.GeneralScheme.EncodedValue
,SMSDataCodingScheme.MessageCodingScheme.EncodedValue
,SMSDataCodingScheme.MessageWaitingScheme.EncodedValue
,SMSFailureCause
,SMSProtocolId.ApplicationLayerProtocol
,SMSProtocolId.EncodedValue
,SMSProtocolId.ServiceCentreProtocol
,SMSProtocolId.TelematicDevice
,SMSProtocolId.TransferLayerProtocol
,SSCode.EncodedValue
public abstract class NamedInteger extends Number implements DataObject, Immutable
Superclass for integer values that have certain well-known named values, but can also take other values.
Subclasses of NamedInteger shall offer these methods and fields, where T is the name of the subclass:public static T fromValue(int value)
public static T[] namedValues()
public static int MIN_VALUE
public static int MAX_VALUE
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NamedInteger(long value)
Constructs an integer without an associated name.protected
NamedInteger(long value, String description)
Constructs an integer with an associated name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
byteValue()
Returns the value of this number as a byte.Object
clone()
Perform a deep copy of this object.double
doubleValue()
Returns the value of this number as a double.boolean
equals(Object obj)
Compares some other object to this one for equality by value (not reference).float
floatValue()
Returns the value of this number as a float.int
hashCode()
Gets a hash code value for this object.int
intValue()
Returns the value of this number as an int.boolean
isReadOnly()
Check if this object has been set read-only.long
longValue()
Returns the value of this number as a long.void
setReadOnly()
Set this object to be "read-only".short
shortValue()
Returns the value of this number as a short.String
toString()
Returns either the name of this number if it has a name, or a string formed from the decimal digits of the number.static <T extends NamedInteger>
TvalueOf(Class<T> namedIntegerType, String name)
Gets the NamedInteger of the given type that has the given name.
-
-
-
Constructor Detail
-
NamedInteger
protected NamedInteger(long value, String description)
Constructs an integer with an associated name.- Parameters:
value
- integerdescription
- name
-
NamedInteger
protected NamedInteger(long value)
Constructs an integer without an associated name. One can think of the decimal representation of the integer as being its default name.- Parameters:
value
- integer
-
-
Method Detail
-
clone
public Object clone()
Description copied from interface:DataObject
Perform a deep copy of this object. Read-only state of the object is not copied; the new object will be read-write by default.Inherently immutable objects may optionally return the same object without modification from clone(), rather than constructing a new instance.
- Specified by:
clone
in interfaceDataObject
- Overrides:
clone
in classObject
- Returns:
- a new object that is a deep copy of this object; for immutable objects, the same object may optionally be returned.
-
setReadOnly
public void setReadOnly()
Description copied from interface:DataObject
Set this object to be "read-only". Any subsequent attempt to modify this object will throw IllegalStateException. Once an object has been made read-only, it cannot be later set to read-write - this is a "one-way" operation.Note that a read-only object is not necessarily immutable; if reference types are returned from accessors, then callers could theoretically mutate those objects even if the top-level object is marked as read-only. The ability to make objects read-only is intended to catch programming errors (e.g. attempting to modify a data object passed as part of a SLEE event), not to provide an absolute guarantee of immutability.
Calling setReadOnly() on an object that is already read-only is a no-op.
Some DataObject implementations may be inherently immutable. In those cases, they are considered always read-only.
- Specified by:
setReadOnly
in interfaceDataObject
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:DataObject
Check if this object has been set read-only.- Specified by:
isReadOnly
in interfaceDataObject
- Returns:
- true if the object is read-only or inherently immutable
- See Also:
DataObject.setReadOnly()
-
byteValue
public byte byteValue()
Returns the value of this number as a byte.
-
doubleValue
public double doubleValue()
Returns the value of this number as a double.- Specified by:
doubleValue
in classNumber
- Returns:
- double
-
floatValue
public float floatValue()
Returns the value of this number as a float.- Specified by:
floatValue
in classNumber
- Returns:
- float
-
intValue
public int intValue()
Returns the value of this number as an int.
-
longValue
public long longValue()
Returns the value of this number as a long.
-
shortValue
public short shortValue()
Returns the value of this number as a short.- Overrides:
shortValue
in classNumber
- Returns:
- short
-
toString
public String toString()
Returns either the name of this number if it has a name, or a string formed from the decimal digits of the number.
-
equals
public boolean equals(Object obj)
Compares some other object to this one for equality by value (not reference). For two NamedIntegers to be equal, they shall have both the same numeric value and also be of the same subclass of NamedInteger.
-
hashCode
public int hashCode()
Gets a hash code value for this object.
-
valueOf
public static <T extends NamedInteger> T valueOf(Class<T> namedIntegerType, String name)
Gets the NamedInteger of the given type that has the given name.- Parameters:
namedIntegerType
- the class of the resultname
- the name of the result- Returns:
- the named static instance
- Throws:
IllegalArgumentException
- if name isn't found, or namedIntegerType does not meet the contract for NamedInteger subtypesNullPointerException
- if namedIntegerType or name is null
-
-