Class Header<T extends RpmBaseTag>

    • Constructor Detail

      • Header

        public Header​(HeaderEntry[] entries,
                      java.nio.charset.Charset charset)
      • Header

        public Header​(Header<T> other)
      • Header

        public Header()
    • Method Detail

      • size

        public int size()
      • putNull

        public void putNull​(int tag)
      • putNull

        public void putNull​(T tag)
      • putByte

        public void putByte​(int tag,
                            byte... value)
      • putByte

        public void putByte​(T tag,
                            byte... value)
      • putShort

        public void putShort​(int tag,
                             short... value)
      • putShort

        public void putShort​(T tag,
                             short... value)
      • putInt

        public void putInt​(int tag,
                           int... value)
      • putInt

        public void putInt​(T tag,
                           int... value)
      • putLong

        public void putLong​(int tag,
                            long... value)
      • putLong

        public void putLong​(T tag,
                            long... value)
      • putString

        public void putString​(int tag,
                              java.lang.String value)
      • putString

        public void putString​(T tag,
                              java.lang.String value)
      • putStringOptional

        public void putStringOptional​(int tag,
                                      java.lang.String value)
      • putStringOptional

        public void putStringOptional​(T tag,
                                      java.lang.String value)
      • putStringArray

        public void putStringArray​(int tag,
                                   java.lang.String... value)
      • putStringArray

        public void putStringArray​(T tag,
                                   java.lang.String... value)
      • putI18nString

        public void putI18nString​(int tag,
                                  java.lang.String... value)
      • putI18nString

        public void putI18nString​(T tag,
                                  java.lang.String... value)
      • putBlob

        public void putBlob​(int tag,
                            byte[] value)
      • putBlob

        public void putBlob​(int tag,
                            java.nio.ByteBuffer value)
      • putBlob

        public void putBlob​(T tag,
                            byte[] value)
      • putBlob

        public void putBlob​(T tag,
                            java.nio.ByteBuffer value)
      • putSize

        public void putSize​(long value,
                            T intTag,
                            T longTag)
      • remove

        public void remove​(int tag)
      • remove

        public void remove​(RpmTag tag)
      • get

        public java.lang.Object get​(int tag)
      • get

        public java.lang.Object get​(T tag)
      • getValue

        public java.util.Optional<java.lang.Object> getValue​(T tag)
        Description copied from interface: ReadableHeader
        Get the value from a header structure
        Specified by:
        getValue in interface ReadableHeader<T extends RpmBaseTag>
        Parameters:
        tag - the tag
        Returns:
        the optional value
      • makeEntries

        public HeaderEntry[] makeEntries​(java.nio.charset.Charset charset)
        Make an array of header entries with given charset

        Note: Further updates on this instance will not update the returned array. This is actually a copy of the current state.

        Parameters:
        charset - the charset of choice
        Returns:
        a new array of all header entries, unsorted
      • makeEntries

        public HeaderEntry[] makeEntries()
        Make an array of header entries

        Note: Further updates on this instance will not update the returned array. This is actually a copy of the current state.

        Returns:
        a new array of all header entries, unsorted
      • putFields

        public static <E,​V,​T extends RpmBaseTag> void putFields​(Header<T> header,
                                                                            java.util.Collection<E> entries,
                                                                            T tag,
                                                                            Header.ArrayAllocator<V> arrayAllocator,
                                                                            java.util.function.Function<E,​V> func,
                                                                            Header.Putter<T,​V> putter)
      • putIntFields

        public static <E,​T extends RpmBaseTag> void putIntFields​(Header<T> header,
                                                                       java.util.Collection<E> entries,
                                                                       T tag,
                                                                       java.util.function.ToIntFunction<E> func)
      • putLongFields

        public static <E,​T extends RpmBaseTag> void putLongFields​(Header<T> header,
                                                                        java.util.Collection<E> entries,
                                                                        T tag,
                                                                        java.util.function.ToLongFunction<E> func)