org.fourthline.cling.model.types

## Class Base64Datatype

- java.lang.Object
- - org.fourthline.cling.model.types.AbstractDatatype<byte[]>
  - - org.fourthline.cling.model.types.Base64Datatype

- All Implemented Interfaces:
    Datatype<byte[]>

      public class Base64Datatype
      extends AbstractDatatype<byte[]>

  Author:
    Christian Bauer

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.fourthline.cling.model.types.Datatype

      `Datatype.Builtin, Datatype.Default`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Base64Datatype()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getString(byte[] value)` Transforms a value supported by this datatype into a string representation.
    `Class<byte[]>` | `getValueType()`
    `byte[]` | `valueOf(String s)` Transforms a string representation into a value of the supported type.

    - ### Methods inherited from class org.fourthline.cling.model.types.AbstractDatatype

      `getBuiltin, getDisplayString, isHandlingJavaType, isValid, setBuiltin, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Base64Datatype

          public Base64Datatype()

  - ### Method Detail

    - #### getValueType

          public Class<byte[]> getValueType()

      Overrides:
        `getValueType` in class `AbstractDatatype<byte[]>`

    - #### valueOf

          public byte[] valueOf(String s)
                         throws InvalidValueException

      Description copied from interface: `Datatype`
      Transforms a string representation into a value of the supported type.
      Specified by:
        `valueOf` in interface `Datatype<byte[]>`
      Overrides:
        `valueOf` in class `AbstractDatatype<byte[]>`
      Parameters:
        `s` - The string representation of a value.
      Returns:
        The converted value or `null` if the string was `null` or empty.
      Throws:
        `InvalidValueException` - If the string couldn't be parsed.

    - #### getString

          public String getString(byte[] value)
                           throws InvalidValueException

      Description copied from interface: `Datatype`
      Transforms a value supported by this datatype into a string representation.

      This method calls `Datatype.isValid(Object)` before converting the value, it throws an exception if validation fails.

      Specified by:
        `getString` in interface `Datatype<byte[]>`
      Overrides:
        `getString` in class `AbstractDatatype<byte[]>`
      Parameters:
        `value` - The value to transform.
      Returns:
        The transformed value as a string, or an empty string when the value is null, never returns `null`.
      Throws:
        `InvalidValueException`

Copyright © 2015 4th Line GmbH, Switzerland. All rights reserved.