Annotation Interface ToScalar


@Retention(RUNTIME) @Target({TYPE,FIELD,PARAMETER,METHOD}) @Documented @Experimental("Allow you to map to a certain scalar class. Not covered by the specification. Subject to change.") @Deprecated public @interface ToScalar
Deprecated.
Use AdaptToScalar
Allows users to map a certain field or class to a scalar type
This is an experimental feature that might move to the spec.
Example:
 public class Profile {
     //  Map a Scalar to another existing Scalar
     @ToScalar(Scalar.Int.class)
     private Long id;

     // Map a POJO to another existing Scalar
     @ToScalar(Scalar.String.class)
     private IdNumber idNumber;

     // Map a List of POJOs to a list of existing Scalars
     @ToScalar(Scalar.String.class)
     private List<Website> bookmarks;

     // other getters/setters...
 }
 
Author:
Phillip Kruger (phillip.kruger@redhat.com)
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<? extends Scalar>
    Deprecated.
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Deprecated.
     
  • Element Details

    • value

      Class<? extends Scalar> value
      Deprecated.
      Returns:
      the scalar to use.
    • deserializeMethod

      String deserializeMethod
      Deprecated.
      Default:
      ""