/** * Method to calculate the next privilege bits associated with this instance. * * @return an new instance of {@code PrivilegeBits} */ @NotNull public PrivilegeBits nextBits() { if (this == EMPTY) { return EMPTY; } else { return new PrivilegeBits(d.next()); } }
/** * Method to calculate the next privilege bits associated with this instance. * * @return an new instance of {@code PrivilegeBits} */ @Nonnull public PrivilegeBits nextBits() { if (this == EMPTY) { return EMPTY; } else { return new PrivilegeBits(d.next()); } }
/** * Internal method to create a new instance of {@code PrivilegeBits}. * * @param bits A long array. * @return an instance of {@code PrivilegeBits} */ @Nonnull private static PrivilegeBits getInstance(long[] bits) { return new PrivilegeBits(new UnmodifiableData(bits)); }
/** * Internal method to create a new instance of {@code PrivilegeBits}. * * @param bits A long array. * @return an instance of {@code PrivilegeBits} */ @NotNull private static PrivilegeBits getInstance(long[] bits) { return new PrivilegeBits(new UnmodifiableData(bits)); }
/** * Creates a mutable instance of privilege bits. * * @return a new instance of privilege bits. */ public static PrivilegeBits getInstance() { return new PrivilegeBits(new ModifiableData()); }
/** * Internal method to get or create an instance of privilege bits for the * specified long value. * * @param bits A long value. * @return an instance of {@code PrivilegeBits} */ @NotNull private static PrivilegeBits getInstance(long bits) { if (bits == NO_PRIVILEGE) { return EMPTY; } else { checkArgument(bits > NO_PRIVILEGE); if (BUILT_IN_BITS != null) { String key = BUILT_IN_BITS.get(bits); if (key != null) { return BUILT_IN.get(key); } } return new PrivilegeBits(new UnmodifiableData(bits)); } }
/** * Internal method to get or create an instance of privilege bits for the * specified long value. * * @param bits A long value. * @return an instance of {@code PrivilegeBits} */ @Nonnull private static PrivilegeBits getInstance(long bits) { if (bits == NO_PRIVILEGE) { return EMPTY; } else { checkArgument(bits > NO_PRIVILEGE); return new PrivilegeBits(new UnmodifiableData(bits)); } }
/** * Creates a mutable instance of privilege bits. * * @return a new instance of privilege bits. */ public static PrivilegeBits getInstance() { return new PrivilegeBits(new ModifiableData()); }