|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IVersionableValue
An interface for flags and enumeration constants whose values are protocol-version dependent.
This interface is a marker interface for IFlag
- or Enum
-properties, whose values
have changed between different MythTv-protocol versions.
A flag or properties marked with this
interface is capable to return different property values for different protocol versions.
TUNER_BUSY
had a value of 12
for
the protocol range [00,19)
and a value of -8
for the protocol range [19,-1)
.
public interface IProgramRecordingStatus extends IVersionable { public static enum Status implements IVersionableValue { ... TUNER_BUSY( // 00 <= protocol < 19 VersionablePair.valueOf(PROTO_VERSION_00, 12), // 19 <= protocol VersionablePair.valueOf(PROTO_VERSION_19, -8) ), ... } }
FL_WATCHED
has changed in protocol version 57
.
public interface IProgramFlags extends IVersionable, IFlagGroup<IProgramFlags.Flags> { public static enum Flags implements IFlag, IVersionableValue { ... FL_WATCHED( // 31 <= protocol < 57 VersionablePair.valueOf(PROTO_VERSION_31, 0x00000800), // 57 <= protocol VersionablePair.valueOf(PROTO_VERSION_57, 0x00000200) ), ... } }
// the following will return 12 Integer value1 = IProgramRecordingStatus.Status.TUNER_BUSY.getValue(PROTO_VERSION_05); // the following will return -8 Integer value2 = IProgramRecordingStatus.Status.TUNER_BUSY.getValue(PROTO_VERSION_20);
EnumUtils
class provides additional methods to work with versionable values.// the following will return 12 Integer value1 = EnumUtils.getVersionableValue(PROTO_VERSION_05, IProgramRecordingStatus.Status.TUNER_BUSY); // the following will return -8 Integer value2 = EnumUtils.getVersionableValue(PROTO_VERSION_20, IProgramRecordingStatus.Status.TUNER_BUSY);
// the following returns TUNER_BUSY IProgramRecordingStatus.Status status = EnumUtils.getVersionableValueEnum(IProgramRecordingStatus.Status.class,PROTO_VERSION_19,-8);
EnumUtils.getVersionableValueEnum(Class, ProtocolVersion, Long)
,
EnumUtils.getVersionableValue(ProtocolVersion, IVersionableValue)
Nested Class Summary | |
---|---|
static class |
IVersionableValue.VersionablePair
|
Method Summary | |
---|---|
Long |
getValue(ProtocolVersion protoVersion)
Returns the actual property value for the given protocol version. |
IVersionableValue.VersionablePair[] |
getValues()
Gets all possible values for the given property. |
Method Detail |
---|
IVersionableValue.VersionablePair[] getValues()
There are some restrictions to the content of the array:
FL_BOOKMARK(0x00000010)
.FL_INUSERECORDING(VersionablePair.valueOf(PROTO_VERSION_21,0x00000020),VersionablePair.valueOf(PROTO_VERSION_57,0x00100000))
.
Long getValue(ProtocolVersion protoVersion)
protoVersion
- the protocol version
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |