@Test public void testGetBitAtPosition() { assertThat(getBitAtPosition(0L, 0), is(false)); assertThat(getBitAtPosition(0L, 31), is(false)); assertThat(getBitAtPosition(1L, 31), is(true)); assertThat(getBitAtPosition(0xFF000000L, 7), is(true)); assertThat(getBitAtPosition(0xFF000000L, 8), is(false)); for (int i = 0; i < 32; i++) { assertThat(getBitAtPosition(Ip.MAX.asLong(), i), equalTo(true)); } }
public static boolean getBitAtPosition(Ip ip, int position) { return getBitAtPosition(ip.asLong(), position); }
Ip implements Comparable<Ip>, Serializable { public static boolean getBitAtPosition(Ip ip, int position) { return getBitAtPosition(ip.asLong(), position); } }
Ip implements Comparable<Ip>, Serializable { public static boolean getBitAtPosition(Ip ip, int position) { return getBitAtPosition(ip.asLong(), position); } private  Ip(long ipAsLong); }
Ip implements Comparable<Ip>, Serializable { public static boolean getBitAtPosition(Ip ip, int position) { return getBitAtPosition(ip.asLong(), position); } private  Ip(long ipAsLong); static boolean getBitAtPosition(Ip ip, int position); static boolean getBitAtPosition(long bits, int position); static Ip numSubnetBitsToSubnetMask(int numBits); static @Nonnull Optional<Ip> tryParse(@Nonnull String text); @JsonCreator static Ip parse(String ipAsString); static Ip create(long ipAsLong); long asLong(); @Override int compareTo(Ip rhs); @Override boolean equals(@Nullable Object o); Ip getClassMask(); int getClassNetworkSize(); Ip getNetworkAddress(int subnetBits); @Override int hashCode(); Ip inverted(); int numSubnetBits(); @Nonnull IpIpSpace toIpSpace(); @Override @JsonValue String toString(); boolean valid(); Prefix toPrefix(); }
Ip implements Comparable<Ip>, Serializable { public static boolean getBitAtPosition(Ip ip, int position) { return getBitAtPosition(ip.asLong(), position); } private  Ip(long ipAsLong); static boolean getBitAtPosition(Ip ip, int position); static boolean getBitAtPosition(long bits, int position); static Ip numSubnetBitsToSubnetMask(int numBits); static @Nonnull Optional<Ip> tryParse(@Nonnull String text); @JsonCreator static Ip parse(String ipAsString); static Ip create(long ipAsLong); long asLong(); @Override int compareTo(Ip rhs); @Override boolean equals(@Nullable Object o); Ip getClassMask(); int getClassNetworkSize(); Ip getNetworkAddress(int subnetBits); @Override int hashCode(); Ip inverted(); int numSubnetBits(); @Nonnull IpIpSpace toIpSpace(); @Override @JsonValue String toString(); boolean valid(); Prefix toPrefix(); static final Ip AUTO; static final Ip FIRST_CLASS_A_PRIVATE_IP; static final Ip FIRST_CLASS_B_PRIVATE_IP; static final Ip FIRST_CLASS_C_PRIVATE_IP; static final Ip FIRST_CLASS_E_EXPERIMENTAL_IP; static final Ip FIRST_MULTICAST_IP; static final Ip MAX; static final Ip ZERO; }