Annotation Type B2Json.type


  • @Retention(RUNTIME)
    @Target(TYPE)
    public static @interface B2Json.type
    Type annotation used to configure B2Json serialization/deserialization. When versionParam is non-empty, it is the name of a parameter that is not a field name, and will take the version number being constructed. This should be included for objects that have multiple versions, and the code in the constructor should validate the data based on it.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String discards
      When discards is non-empty, is a comma-separated list of field names which are allowed to be present in the parsed json, but whose values will be discarded.
      java.lang.String versionParam
      When versionParam is non-empty, it is the name of a parameter that is not a field name, and will take the version number being constructed.
    • Element Detail

      • discards

        java.lang.String discards
        When discards is non-empty, is a comma-separated list of field names which are allowed to be present in the parsed json, but whose values will be discarded. The names may be for fields that don't exist or for fields marked @ignored. This is useful for accepting deprecated fields without having to use ALLOW_EXTRA_FIELDS, which would accept ALL unknown fields.
        Returns:
        A comma separated list of fields to discard, or an empty string
        Default:
        ""
      • versionParam

        java.lang.String versionParam
        When versionParam is non-empty, it is the name of a parameter that is not a field name, and will take the version number being constructed. This should be included for objects that have multiple versions, and the code in the constructor should validate the data based on it.
        Returns:
        the version parameter if present, or an empty string
        Default:
        ""