Enum Class MarshalledAs

java.lang.Object
java.lang.Enum<MarshalledAs>
org.apache.juneau.marshall.MarshalledAs
All Implemented Interfaces:
Serializable, Comparable<MarshalledAs>, Constable

public enum MarshalledAs extends Enum<MarshalledAs>
Specifies the marshalling strategy for a type annotated with @Marshalled.
  • Enum Constant Details

    • DETECT

      public static final MarshalledAs DETECT
      Auto-detect the marshalling strategy (default).

      The marshalling engine inspects the type and selects the best strategy (bean, map, collection, string swap, etc.).

    • STRING

      public static final MarshalledAs STRING
      Serialize using Object.toString() and deserialize using a fromString(String), valueOf(String), or single-String-argument constructor.

      Replaces the common MarshallingStringSwap use case without requiring a separate swap class.

  • Method Details

    • values

      public static MarshalledAs[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MarshalledAs valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null