HlsMediaPlaylist.ClientDefinedAttribute


public class HlsMediaPlaylist.ClientDefinedAttribute


A client defined attribute. See RFC 8216bis, section 4.4.5.1.

Summary

Nested types

@Retention(value = RetentionPolicy.SOURCE)
@IntDef(value = )
@Documented
@Target(value = TYPE_USE)
public annotation HlsMediaPlaylist.ClientDefinedAttribute.Type

The type of the client defined attribute.

Constants

static final int

Type double.

static final int

Type hex text.

static final int

Type text.

Public fields

final double
final String

The name of the client defined attribute.

final @Nullable String
final int

The type of the client defined attribute.

Public constructors

ClientDefinedAttribute(String name, double value)

Creates an instance of type TYPE_DOUBLE.

ClientDefinedAttribute(
    String name,
    String value,
    @HlsMediaPlaylist.ClientDefinedAttribute.Type int type
)

Creates an instance of type TYPE_TEXT or TYPE_HEX_TEXT.

Public methods

boolean
double

Returns the value if the attribute is of TYPE_DOUBLE.

String

Returns the text value if the attribute is of TYPE_TEXT or TYPE_HEX_TEXT.

int

Constants

TYPE_DOUBLE

public static final int TYPE_DOUBLE = 2

Type double. See RFC 8216bis, section 4.2, decimal-floating-point.

TYPE_HEX_TEXT

public static final int TYPE_HEX_TEXT = 1

Type hex text. See RFC 8216bis, section 4.2, hexadecimal-sequence.

TYPE_TEXT

public static final int TYPE_TEXT = 0

Type text. See RFC 8216bis, section 4.2, quoted-string.

Public fields

doubleValue

public final double doubleValue

name

public final String name

The name of the client defined attribute.

textValue

public final @Nullable String textValue

type

public final int type

The type of the client defined attribute.

Public constructors

ClientDefinedAttribute

public ClientDefinedAttribute(String name, double value)

Creates an instance of type TYPE_DOUBLE.

ClientDefinedAttribute

public ClientDefinedAttribute(
    String name,
    String value,
    @HlsMediaPlaylist.ClientDefinedAttribute.Type int type
)

Creates an instance of type TYPE_TEXT or TYPE_HEX_TEXT.

Public methods

equals

public boolean equals(@Nullable Object o)

getDoubleValue

public double getDoubleValue()

Returns the value if the attribute is of TYPE_DOUBLE.

Throws
java.lang.IllegalStateException

if the attribute is not of type TYPE_TEXT or TYPE_HEX_TEXT.

getTextValue

public String getTextValue()

Returns the text value if the attribute is of TYPE_TEXT or TYPE_HEX_TEXT.

Throws
java.lang.IllegalStateException

if the attribute is not of type TYPE_DOUBLE.

hashCode

public int hashCode()