Class Header<T extends RpmBaseTag>

java.lang.Object
org.eclipse.packager.rpm.header.Header<T>
All Implemented Interfaces:
ReadableHeader<T>

public class Header<T extends RpmBaseTag> extends Object implements ReadableHeader<T>
  • Constructor Details

  • Method Details

    • 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, String value)
    • putString

      public void putString(T tag, String value)
    • putStringOptional

      public void putStringOptional(int tag, String value)
    • putStringOptional

      public void putStringOptional(T tag, String value)
    • putStringArray

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

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

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

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

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

      public void putBlob(int tag, ByteBuffer value)
    • putBlob

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

      public void putBlob(T tag, ByteBuffer value)
    • putSize

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

      public void putAll(Header<T> headers)
    • remove

      public void remove(int tag)
    • remove

      public void remove(RpmTag tag)
    • get

      public Object get(int tag)
    • get

      public Object get(T tag)
    • getValue

      public Optional<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(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, Collection<E> entries, T tag, Header.ArrayAllocator<V> arrayAllocator, Function<E,V> func, Header.Putter<T,V> putter)
    • putShortFields

      public static <E, T extends RpmBaseTag> void putShortFields(Header<T> header, Collection<E> entries, T tag, Header.ToShortFunction<E> func)
    • putIntFields

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

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