Annotation Type DefaultValue


  • @Retention(RUNTIME)
    @Target({METHOD,TYPE})
    public @interface DefaultValue
    This model annotation allows to define custom default values for properties.

    Example Model:

    
     package mypkg.vmfmodel;
    
     import eu.mihosoft.vmf.core.*;
     
     interface ObjectWithDefaultValues {
         
         @DefaultValue(value="23")
         Integer getValue();
     
         @DefaultValue(value="\"my name\"")
         String getName();
     }
     

    Additional Notes:

    Default values are also responsible for defining whether a value is set or unset. Usually, properties have the default value null. It is set if it is not null and unset if it is null. If the default value is different from null it is unset if it is equal to the custom default value and set if it is not equal to the custom default value.

    Created by miho on 18.06.2018.

    See Also:
    Custom Default Values for Properties
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String value  
    • Element Detail

      • value

        java.lang.String value