Package org.openmuc.jdlms
Class ObisCode
- java.lang.Object
-
- org.openmuc.jdlms.ObisCode
-
public class ObisCode extends java.lang.Object
Represents the address of a remote object according to IEC 62056-6-1. An instance of ObisCode is immutable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObisCode.Medium
-
Constructor Summary
Constructors Constructor Description ObisCode(byte[] bytes)
ObisCode(int byteA, int byteB, int byteC, int byteD, int byteE, int byteF)
ConstructorObisCode(java.lang.String address)
The reference-id can be written as OBIS number (e.g. 1-b:8.29.0*2) or as a series of six decimal numbers separated by periods (1.1.1.8.0.255).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asDecimalString()
java.lang.String
asHexCodeString()
java.lang.String
asShortObisCodeString()
byte[]
bytes()
int
channel()
boolean
equals(java.lang.Object obj)
int
hashCode()
ObisCode.Medium
medium()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ObisCode
public ObisCode(int byteA, int byteB, int byteC, int byteD, int byteE, int byteF)
Constructor- Parameters:
byteA
- First byte of the addressbyteB
- Second byte of the addressbyteC
- Third byte of the addressbyteD
- Fourth byte of the addressbyteE
- Fifth byte of the addressbyteF
- Sixth byte of the address- Throws:
java.lang.IllegalArgumentException
- If one of the bytes is out of range [0, 255]
-
ObisCode
public ObisCode(java.lang.String address)
The reference-id can be written as OBIS number (e.g. 1-b:8.29.0*2) or as a series of six decimal numbers separated by periods (1.1.1.8.0.255).- Parameters:
address
- Reference-ID
-
ObisCode
public ObisCode(byte[] bytes)
-
-
Method Detail
-
medium
public ObisCode.Medium medium()
-
channel
public int channel()
-
asShortObisCodeString
public java.lang.String asShortObisCodeString()
-
asHexCodeString
public java.lang.String asHexCodeString()
-
bytes
public byte[] bytes()
-
asDecimalString
public java.lang.String asDecimalString()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-