org.jmythapi.protocol.response
Interface IEnumGroup<E extends Enum<E>>

All Superinterfaces:
Cloneable, IGroup<E>, IVersionable
All Known Subinterfaces:
IJobCommand, IJobStatus, IJobType, IProgramRecordingSearchType, IProgramRecordingStatus, IProgramRecordingType
All Known Implementing Classes:
ADatabaseEnumGroup, AEnumGroup, AVersionableEnumGroup, JobCommands, JobStatus, JobType, ProgramRecordingSearchType, ProgramRecordingStatus, ProgramRecordingType

public interface IEnumGroup<E extends Enum<E>>
extends IGroup<E>

An enum group.

This interface represents a enum group. The value of a enum group is a single integer value, which can be accessed using IGroup.longValue(). How this value can be interpreted, depends on the available constants of the enumeration group. Depending on the current protocol-version of the group, different constants may be available with different types.

In an enum group only a single constant can be active at the same time.

See IGroup.longValue() for the current value of the group.
See IGroup.getGroupClass() for the enum class defining all possible constants.

To test if a specific constant is currently active, hasEnum(Enum) can be used.

Usage Example:


    // getting the enum group
    IProgramRecordingStatus recStatus = recording.getRecordingStatus();
    
    // testing for an active enum
    if(recStatus.hasEnum(Status.RECORDING)) {
       // do something
    }
  


Method Summary
 E getEnum()
          Gets the current value as enum.
 boolean hasEnum(E... props)
           
 boolean hasEnum(E prop)
           
 
Methods inherited from interface org.jmythapi.protocol.response.IGroup
getGroupClass, longValue
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 

Method Detail

getEnum

E getEnum()
Gets the current value as enum.

Returns:
the current enum value

hasEnum

boolean hasEnum(E prop)

hasEnum

boolean hasEnum(E... props)


Copyright © 2008-2013. All Rights Reserved.