/** * Construct a new immutable {@code JCGLBufferUpdate} instance. * @param buffer The value for the {@code buffer} attribute * @param data The value for the {@code data} attribute * @param dataUpdateRange The value for the {@code dataUpdateRange} attribute * @return An immutable JCGLBufferUpdate instance */ public static <T extends JCGLBufferWritableType> JCGLBufferUpdate<T> of(T buffer, ByteBuffer data, UnsignedRangeInclusiveL dataUpdateRange) { return new JCGLBufferUpdate<T>(buffer, data, dataUpdateRange); }
/** * This instance is equal to all instances of {@code JCGLBufferUpdate} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @SuppressWarnings("unchecked") @Override public boolean equals(Object another) { if (this == another) return true; return another instanceof JCGLBufferUpdate<?> && equalTo((JCGLBufferUpdate<T>) another); }
ByteBuffer.allocateDirect((int) range.getInterval()); data.order(ByteOrder.nativeOrder()); return JCGLBufferUpdate.of(buffer, data, range);
/** * Builds a new {@link JCGLBufferUpdate JCGLBufferUpdate}. * @return An immutable instance of JCGLBufferUpdate * @throws java.lang.IllegalStateException if any required attributes are missing */ public JCGLBufferUpdate<T> build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new JCGLBufferUpdate<T>(this); }