Class HashFieldMap<T>

  • All Implemented Interfaces:
    FieldMap<T>

    final class HashFieldMap<T>
    extends java.lang.Object
    implements FieldMap<T>
    Field mapping implemented on top of hash for field lookup by number. This is the less efficient than ArrayFieldMap for almost all cases. But in case when field numbers are sparse and especially when max field number is big - this mapping should be used.
    See Also:
    ArrayFieldMap
    • Field Detail

      • fields

        private final java.util.List<Field<T>> fields
      • fieldsByNumber

        private final java.util.Map<java.lang.Integer,​Field<T>> fieldsByNumber
      • fieldsByName

        private final java.util.Map<java.lang.String,​Field<T>> fieldsByName
    • Constructor Detail

      • HashFieldMap

        public HashFieldMap​(java.util.Collection<Field<T>> fields)