Package org.eclipse.packager.rpm.header
Class Header<T extends RpmBaseTag>
java.lang.Object
org.eclipse.packager.rpm.header.Header<T>
- All Implemented Interfaces:
ReadableHeader<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfaceHeader.Putter<T extends RpmBaseTag,V> static interface -
Constructor Summary
ConstructorsConstructorDescriptionHeader()Header(HeaderEntry[] entries) Header(HeaderEntry[] entries, Charset charset) -
Method Summary
Modifier and TypeMethodDescriptionget(int tag) Get the value from a header structureMake an array of header entriesmakeEntries(Charset charset) Make an array of header entries with given charsetvoidvoidputBlob(int tag, byte[] value) voidputBlob(int tag, ByteBuffer value) voidvoidputBlob(T tag, ByteBuffer value) voidputByte(int tag, byte... value) voidstatic <E,V, T extends RpmBaseTag>
voidputFields(Header<T> header, Collection<E> entries, T tag, Header.ArrayAllocator<V> arrayAllocator, Function<E, V> func, Header.Putter<T, V> putter) voidputI18nString(int tag, String... value) voidputI18nString(T tag, String... value) voidputInt(int tag, int... value) voidstatic <E,T extends RpmBaseTag>
voidputIntFields(Header<T> header, Collection<E> entries, T tag, ToIntFunction<E> func) voidputLong(int tag, long... value) voidstatic <E,T extends RpmBaseTag>
voidputLongFields(Header<T> header, Collection<E> entries, T tag, ToLongFunction<E> func) voidputNull(int tag) voidvoidputShort(int tag, short... value) voidstatic <E,T extends RpmBaseTag>
voidputShortFields(Header<T> header, Collection<E> entries, T tag, Header.ToShortFunction<E> func) voidvoidvoidvoidputStringArray(int tag, String... value) voidputStringArray(T tag, String... value) voidputStringOptional(int tag, String value) voidputStringOptional(T tag, String value) voidremove(int tag) voidintsize()
-
Constructor Details
-
Header
-
Header
-
Header
-
Header
public Header()
-
-
Method Details
-
size
public int size() -
putNull
public void putNull(int tag) -
putNull
-
putByte
public void putByte(int tag, byte... value) -
putByte
-
putShort
public void putShort(int tag, short... value) -
putShort
-
putInt
public void putInt(int tag, int... value) -
putInt
-
putLong
public void putLong(int tag, long... value) -
putLong
-
putString
-
putString
-
putStringOptional
-
putStringOptional
-
putStringArray
-
putStringArray
-
putI18nString
-
putI18nString
-
putBlob
public void putBlob(int tag, byte[] value) -
putBlob
-
putBlob
-
putBlob
-
putSize
-
putAll
-
remove
public void remove(int tag) -
remove
-
get
-
get
-
getValue
Description copied from interface:ReadableHeaderGet the value from a header structure- Specified by:
getValuein interfaceReadableHeader<T extends RpmBaseTag>- Parameters:
tag- the tag- Returns:
- the optional value
-
makeEntries
Make an array of header entries with given charsetNote: 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
Make an array of header entriesNote: 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, void putFieldsT extends RpmBaseTag> (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)
-