Class PolymorphicMapSchema

  • All Implemented Interfaces:
    Schema<java.lang.Object>

    public abstract class PolymorphicMapSchema
    extends PolymorphicSchema
    Used when the type is an interface (Map/SortedMap).
    • Field Detail

      • ID_UNMODIFIABLE_SORTED_MAP

        static final int ID_UNMODIFIABLE_SORTED_MAP
        See Also:
        Constant Field Values
      • ID_SYNCHRONIZED_SORTED_MAP

        static final int ID_SYNCHRONIZED_SORTED_MAP
        See Also:
        Constant Field Values
      • STR_UNMODIFIABLE_MAP

        static final java.lang.String STR_UNMODIFIABLE_MAP
        See Also:
        Constant Field Values
      • STR_UNMODIFIABLE_SORTED_MAP

        static final java.lang.String STR_UNMODIFIABLE_SORTED_MAP
        See Also:
        Constant Field Values
      • STR_SYNCHRONIZED_MAP

        static final java.lang.String STR_SYNCHRONIZED_MAP
        See Also:
        Constant Field Values
      • STR_SYNCHRONIZED_SORTED_MAP

        static final java.lang.String STR_SYNCHRONIZED_SORTED_MAP
        See Also:
        Constant Field Values
      • STR_CHECKED_SORTED_MAP

        static final java.lang.String STR_CHECKED_SORTED_MAP
        See Also:
        Constant Field Values
      • __nonPublicMaps

        static final java.util.IdentityHashMap<java.lang.Class<?>,​java.lang.Integer> __nonPublicMaps
      • fSingletonMap_k

        static final java.lang.reflect.Field fSingletonMap_k
      • fSingletonMap_v

        static final java.lang.reflect.Field fSingletonMap_v
      • fUnmodifiableMap_m

        static final java.lang.reflect.Field fUnmodifiableMap_m
      • fUnmodifiableSortedMap_sm

        static final java.lang.reflect.Field fUnmodifiableSortedMap_sm
      • fSynchronizedMap_m

        static final java.lang.reflect.Field fSynchronizedMap_m
      • fSynchronizedSortedMap_sm

        static final java.lang.reflect.Field fSynchronizedSortedMap_sm
      • fSynchronizedMap_mutex

        static final java.lang.reflect.Field fSynchronizedMap_mutex
      • fCheckedMap_m

        static final java.lang.reflect.Field fCheckedMap_m
      • fCheckedSortedMap_sm

        static final java.lang.reflect.Field fCheckedSortedMap_sm
      • fCheckedMap_keyType

        static final java.lang.reflect.Field fCheckedMap_keyType
      • fCheckedMap_valueType

        static final java.lang.reflect.Field fCheckedMap_valueType
      • pipeSchema

        protected final Pipe.Schema<java.lang.Object> pipeSchema
    • Constructor Detail

      • PolymorphicMapSchema

        public PolymorphicMapSchema​(IdStrategy strategy)
    • Method Detail

      • map

        private static java.lang.Class<?> map​(java.lang.String className,
                                              int id)
      • name

        static java.lang.String name​(int number)
      • number

        static int number​(java.lang.String name)
      • number

        static int number​(char c)
      • getFieldName

        public java.lang.String getFieldName​(int number)
        Description copied from interface: Schema
        Gets the field name associated with the number. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:
         return String.valueOf(number);
         
      • getFieldNumber

        public int getFieldNumber​(java.lang.String name)
        Description copied from interface: Schema
        Gets the field number associated with the name. This is particularly useful when serializing to different formats (Eg. JSON). When using numeric field names:
         return Integer.parseInt(name);
         
      • messageFullName

        public java.lang.String messageFullName()
        Description copied from interface: Schema
        Returns the full name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getName();
      • messageName

        public java.lang.String messageName()
        Description copied from interface: Schema
        Returns the simple name of the message tied to this schema. Allows custom schemas to provide a custom name other than typeClass().getSimpleName();
      • mergeFrom

        public void mergeFrom​(Input input,
                              java.lang.Object owner)
                       throws java.io.IOException
        Description copied from interface: Schema
        Deserializes a message/object from the input.
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(Output output,
                            java.lang.Object value)
                     throws java.io.IOException
        Description copied from interface: Schema
        Serializes a message/object to the output.
        Throws:
        java.io.IOException
      • idFrom

        static int idFrom​(java.lang.Class<?> clazz)
      • instanceFrom

        static java.lang.Object instanceFrom​(int id)
      • writeObjectTo

        static void writeObjectTo​(Output output,
                                  java.lang.Object value,
                                  Schema<?> currentSchema,
                                  IdStrategy strategy)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • writeNonPublicMapTo

        static void writeNonPublicMapTo​(Output output,
                                        java.lang.Object value,
                                        Schema<?> currentSchema,
                                        IdStrategy strategy)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUnmodifiableMapTo

        private static void writeUnmodifiableMapTo​(Output output,
                                                   java.lang.Object value,
                                                   Schema<?> currentSchema,
                                                   IdStrategy strategy,
                                                   int id)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSynchronizedMapTo

        private static void writeSynchronizedMapTo​(Output output,
                                                   java.lang.Object value,
                                                   Schema<?> currentSchema,
                                                   IdStrategy strategy,
                                                   int id)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeCheckedMapTo

        private static void writeCheckedMapTo​(Output output,
                                              java.lang.Object value,
                                              Schema<?> currentSchema,
                                              IdStrategy strategy,
                                              int id)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readObjectFrom

        static java.lang.Object readObjectFrom​(Input input,
                                               Schema<?> schema,
                                               java.lang.Object owner,
                                               IdStrategy strategy)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • readObjectFrom

        static java.lang.Object readObjectFrom​(Input input,
                                               Schema<?> schema,
                                               java.lang.Object owner,
                                               IdStrategy strategy,
                                               int number)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • fillSingletonMapFrom

        private static java.lang.Object fillSingletonMapFrom​(Input input,
                                                             Schema<?> schema,
                                                             java.lang.Object owner,
                                                             IdStrategy strategy,
                                                             boolean graph,
                                                             java.lang.Object map)
                                                      throws java.io.IOException
        Return true to
        Throws:
        java.io.IOException
      • readUnmodifiableMapFrom

        private static java.lang.Object readUnmodifiableMapFrom​(Input input,
                                                                Schema<?> schema,
                                                                java.lang.Object owner,
                                                                IdStrategy strategy,
                                                                boolean graph,
                                                                java.lang.Object map,
                                                                boolean sm)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readSynchronizedMapFrom

        private static java.lang.Object readSynchronizedMapFrom​(Input input,
                                                                Schema<?> schema,
                                                                java.lang.Object owner,
                                                                IdStrategy strategy,
                                                                boolean graph,
                                                                java.lang.Object map,
                                                                boolean sm)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readCheckedMapFrom

        private static java.lang.Object readCheckedMapFrom​(Input input,
                                                           Schema<?> schema,
                                                           java.lang.Object owner,
                                                           IdStrategy strategy,
                                                           boolean graph,
                                                           java.lang.Object map,
                                                           boolean sm)
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • transferObject

        static void transferObject​(Pipe.Schema<java.lang.Object> pipeSchema,
                                   Pipe pipe,
                                   Input input,
                                   Output output,
                                   IdStrategy strategy)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • transferObject

        static void transferObject​(Pipe.Schema<java.lang.Object> pipeSchema,
                                   Pipe pipe,
                                   Input input,
                                   Output output,
                                   IdStrategy strategy,
                                   int number)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • transferSingletonMap

        static void transferSingletonMap​(Pipe.Schema<java.lang.Object> pipeSchema,
                                         Pipe pipe,
                                         Input input,
                                         Output output,
                                         IdStrategy strategy)
                                  throws java.io.IOException
        Throws:
        java.io.IOException