Class NFDFilterItem

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NFDFilterItem extends Struct<NFDFilterItem> implements NativeResource

 struct nfdfilteritem_t {
     nfdchar_t const * name;
     nfdchar_t const * spec;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • NAME

      public static final int NAME
      The struct member offsets.
    • SPEC

      public static final int SPEC
      The struct member offsets.
  • Constructor Details

    • NFDFilterItem

      public NFDFilterItem(ByteBuffer container)
      Creates a NFDFilterItem instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<NFDFilterItem>
    • name

      public ByteBuffer name()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the name field.
    • nameString

      public String nameString()
      Returns:
      the null-terminated string pointed to by the name field.
    • spec

      public ByteBuffer spec()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the spec field.
    • specString

      public String specString()
      Returns:
      the null-terminated string pointed to by the spec field.
    • name

      public NFDFilterItem name(ByteBuffer value)
      Sets the address of the specified encoded string to the name field.
    • spec

      public NFDFilterItem spec(ByteBuffer value)
      Sets the address of the specified encoded string to the spec field.
    • set

      public NFDFilterItem set(ByteBuffer name, ByteBuffer spec)
      Initializes this struct with the specified values.
    • set

      public NFDFilterItem set(NFDFilterItem src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static NFDFilterItem malloc()
      Returns a new NFDFilterItem instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static NFDFilterItem calloc()
      Returns a new NFDFilterItem instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static NFDFilterItem create()
      Returns a new NFDFilterItem instance allocated with BufferUtils.
    • create

      public static NFDFilterItem create(long address)
      Returns a new NFDFilterItem instance for the specified memory address.
    • createSafe

      public static @Nullable NFDFilterItem createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static NFDFilterItem.Buffer malloc(int capacity)
      Returns a new NFDFilterItem.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static NFDFilterItem.Buffer calloc(int capacity)
      Returns a new NFDFilterItem.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static NFDFilterItem.Buffer create(int capacity)
      Returns a new NFDFilterItem.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static NFDFilterItem.Buffer create(long address, int capacity)
      Create a NFDFilterItem.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable NFDFilterItem.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static NFDFilterItem malloc(MemoryStack stack)
      Returns a new NFDFilterItem instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static NFDFilterItem calloc(MemoryStack stack)
      Returns a new NFDFilterItem instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static NFDFilterItem.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new NFDFilterItem.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static NFDFilterItem.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new NFDFilterItem.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nname

      public static ByteBuffer nname(long struct)
      Unsafe version of name().
    • nnameString

      public static String nnameString(long struct)
      Unsafe version of nameString().
    • nspec

      public static ByteBuffer nspec(long struct)
      Unsafe version of spec().
    • nspecString

      public static String nspecString(long struct)
      Unsafe version of specString().
    • nname

      public static void nname(long struct, ByteBuffer value)
      Unsafe version of name.
    • nspec

      public static void nspec(long struct, ByteBuffer value)
      Unsafe version of spec.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate