Class BooleanContext

  • All Implemented Interfaces:
    TypeContext<java.lang.Boolean>

    public final class BooleanContext
    extends FormatContext<java.lang.Boolean>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.text.Format DEFAULT_FORMAT  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        BooleanContext()  
        BooleanContext​(java.lang.String trueValue, java.lang.String falseValue)  
      private BooleanContext​(java.text.Format format)  
    • Field Detail

      • DEFAULT_FORMAT

        private static final java.text.Format DEFAULT_FORMAT
    • Constructor Detail

      • BooleanContext

        public BooleanContext()
      • BooleanContext

        public BooleanContext​(java.lang.String trueValue,
                              java.lang.String falseValue)
      • BooleanContext

        private BooleanContext​(java.text.Format format)
    • Method Detail

      • enforce

        public java.lang.Boolean enforce​(java.lang.Boolean object)
        Description copied from interface: TypeContext
        Will force the object to conform to the context's specification. The default implementation formats a String and then parses that back to an object (of the original type).
      • configureFormat

        protected void configureFormat​(java.text.Format format,
                                       java.lang.Object object)
        Specified by:
        configureFormat in class FormatContext<java.lang.Boolean>
      • handleFormatException

        protected java.lang.String handleFormatException​(java.text.Format format,
                                                         java.lang.Object object)
        Specified by:
        handleFormatException in class FormatContext<java.lang.Boolean>
      • handleParseException

        protected java.lang.Boolean handleParseException​(java.text.Format format,
                                                         java.lang.String string)
        Specified by:
        handleParseException in class FormatContext<java.lang.Boolean>