Annotation Interface TypeCast


@Retention(CLASS) @Target(METHOD) public @interface TypeCast
Overrides the standard way of casting a certain type in a TypeSystem. This is useful for types where the guest language specific type cast can be implemented more efficiently than a direct cast. The annotated method must be contained in a TypeSystem annotated class. Type checks must conform to the following signature: public static Type as{TypeName}(Object value). The casted type must be a type declared in the TypeSystem.

If no TypeCast is declared then the type system implicitly uses a type cast that can be declared as follows:

 @TypeCast(Type.class)
 public static Type asType(Object value) {
         return (Type) value;
 }
 
Since:
0.8 or earlier
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      Class<?> value
      Since:
      0.8 or earlier