Class GenerationId
- java.lang.Object
-
- org.opends.server.replication.common.GenerationId
-
public final class GenerationId extends Object
The generation id used for a replication domain. It is always positive except for some very specific values likeNO_GENERATION_IDor theSENTINEL_GENERATION_IDused while connecting to an RS.
-
-
Field Summary
Fields Modifier and Type Field Description static GenerationIdDUMMY_GENERATION_IDTO be used for unit testing.static GenerationIdEMPTY_BACKEND_GENERATION_IDThis is the generation id for an empty backend.static GenerationIdNO_GENERATION_IDTo be used when the generation id is not set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()booleanisDifferent(GenerationId other)Whether this generation id is different to the provided one (and both are valid).booleanisEqualToOrNoGenerationId(GenerationId other)Whether this generation id isNO_GENERATION_ID) or equal to the provided one.booleanisNoGenerationId()Whether this is theNO_GENERATION_IDconstant.booleanisSame(GenerationId other)Whether this generation id is the same as the provided one (and none areNO_GENERATION_ID).booleanisValid()Whether this generation id is valid, i.e.longlongValue()The long value of the generation ID.StringtoString()static GenerationIdvalueOf(long generationId)Returns a generation id object having the provided value.static GenerationIdvalueOf(ByteString generationId)Returns a generation id object having the provided value encoded as a ByteString.
-
-
-
Field Detail
-
NO_GENERATION_ID
public static final GenerationId NO_GENERATION_ID
To be used when the generation id is not set.
-
EMPTY_BACKEND_GENERATION_ID
public static final GenerationId EMPTY_BACKEND_GENERATION_ID
This is the generation id for an empty backend.It corresponds to a backend entry count of zero, i.e. we encode
0in ASCII which gives48.
-
DUMMY_GENERATION_ID
public static final GenerationId DUMMY_GENERATION_ID
TO be used for unit testing.
-
-
Method Detail
-
valueOf
public static GenerationId valueOf(long generationId)
Returns a generation id object having the provided value.- Parameters:
generationId- value of the generation id- Returns:
- a generation id object made having the provided value
-
valueOf
public static GenerationId valueOf(ByteString generationId)
Returns a generation id object having the provided value encoded as a ByteString.- Parameters:
generationId- value of the generation id encoded as a ByteString- Returns:
- a generation id object made having the provided value encoded as a ByteString
-
isNoGenerationId
public boolean isNoGenerationId()
Whether this is theNO_GENERATION_IDconstant.- Returns:
- whether this is the
NO_GENERATION_IDconstant
-
longValue
public long longValue()
The long value of the generation ID.- Returns:
- long value of the generation ID
-
isValid
public boolean isValid()
Whether this generation id is valid, i.e. positive.- Returns:
- whether this generation id is valid, i.e. positive
-
isDifferent
public boolean isDifferent(GenerationId other)
Whether this generation id is different to the provided one (and both are valid).- Parameters:
other- the generation id to compare against- Returns:
- whether this generation id is different to the provided one (and both are valid)
-
isSame
public boolean isSame(GenerationId other)
Whether this generation id is the same as the provided one (and none areNO_GENERATION_ID).- Parameters:
other- the generation id to compare against- Returns:
- whether this generation id is the same as the provided one (and none are
NO_GENERATION_ID)
-
isEqualToOrNoGenerationId
public boolean isEqualToOrNoGenerationId(GenerationId other)
Whether this generation id isNO_GENERATION_ID) or equal to the provided one.- Parameters:
other- the generation id to compare against- Returns:
- whether this generation id is
NO_GENERATION_ID) or equal to the provided one
-
-