Package io.protostuff

Class StringMapSchema<V>

  • All Implemented Interfaces:
    Schema<java.util.Map<java.lang.String,​V>>

    public class StringMapSchema<V>
    extends MapSchema<java.lang.String,​V>
    A schema for a Map with String keys. The key and value can be null (depending on the particular map impl).
    • Field Detail

      • VALUE_STRING

        public static final StringMapSchema<java.lang.String> VALUE_STRING
        The schema for Map<String,String>
      • vSchema

        public final Schema<V> vSchema
        The schema of the message value.
      • vPipeSchema

        public final Pipe.Schema<V> vPipeSchema
        The pipe schema of the message value.
    • Constructor Detail

      • StringMapSchema

        public StringMapSchema​(Schema<V> vSchema)
    • Method Detail

      • readKeyFrom

        protected final java.lang.String readKeyFrom​(Input input,
                                                     MapSchema.MapWrapper<java.lang.String,​V> wrapper)
                                              throws java.io.IOException
        Description copied from class: MapSchema
        Reads the key from the input.

        The extra wrapper arg is internally used as an object placeholder during polymorhic deserialization.

        Specified by:
        readKeyFrom in class MapSchema<java.lang.String,​V>
        Throws:
        java.io.IOException
      • putValueFrom

        protected void putValueFrom​(Input input,
                                    MapSchema.MapWrapper<java.lang.String,​V> wrapper,
                                    java.lang.String key)
                             throws java.io.IOException
        Description copied from class: MapSchema
        Puts the entry(key and value), obtained from the input, into the MapWrapper.
        Specified by:
        putValueFrom in class MapSchema<java.lang.String,​V>
        Throws:
        java.io.IOException
      • writeKeyTo

        protected final void writeKeyTo​(Output output,
                                        int fieldNumber,
                                        java.lang.String value,
                                        boolean repeated)
                                 throws java.io.IOException
        Description copied from class: MapSchema
        Writes the key to the output.
        Specified by:
        writeKeyTo in class MapSchema<java.lang.String,​V>
        Throws:
        java.io.IOException
      • writeValueTo

        protected void writeValueTo​(Output output,
                                    int fieldNumber,
                                    V value,
                                    boolean repeated)
                             throws java.io.IOException
        Description copied from class: MapSchema
        Writes the value to the output.
        Specified by:
        writeValueTo in class MapSchema<java.lang.String,​V>
        Throws:
        java.io.IOException
      • transferKey

        protected void transferKey​(Pipe pipe,
                                   Input input,
                                   Output output,
                                   int number,
                                   boolean repeated)
                            throws java.io.IOException
        Description copied from class: MapSchema
        Transfers the key from the input to the output.
        Specified by:
        transferKey in class MapSchema<java.lang.String,​V>
        Throws:
        java.io.IOException
      • transferValue

        protected void transferValue​(Pipe pipe,
                                     Input input,
                                     Output output,
                                     int number,
                                     boolean repeated)
                              throws java.io.IOException
        Description copied from class: MapSchema
        Transfers the value from the input to the output.
        Specified by:
        transferValue in class MapSchema<java.lang.String,​V>
        Throws:
        java.io.IOException