@Test public void testWithoutField() { FieldSelector fields = FieldSelector.fromFields(asList("CLIENT_IP", "CLIENT_PORT", "STATUS")); FieldSelector fieldsWithoutPort = fields.withoutField(Field.CLIENT_PORT); FieldSelector fieldsWithoutPort2 = fieldsWithoutPort.withoutField(Field.CLIENT_PORT); assertThat(fields.getBitmap()).isEqualTo(35); assertThat(fieldsWithoutPort.getBitmap()).isEqualTo(33); assertThat(fieldsWithoutPort2.getBitmap()).isEqualTo(33); }
public FieldSelector withoutField(Field field) { return new FieldSelector(bitmap & ~field.getBit()); }
FieldSelector { public FieldSelector withoutField(Field field) { return new FieldSelector(bitmap & ~field.getBit()); } }
FieldSelector { public FieldSelector withoutField(Field field) { return new FieldSelector(bitmap & ~field.getBit()); } private  FieldSelector(int bitmap); }
FieldSelector { public FieldSelector withoutField(Field field) { return new FieldSelector(bitmap & ~field.getBit()); } private  FieldSelector(int bitmap); int getBitmap(); void ifSelectedRun(Field field, Runnable runnable); boolean isSelected(Field field); FieldSelector withoutField(Field field); static FieldSelector fromBitmap(int bitmap); static FieldSelector fromFields(List<String> fields); }
FieldSelector { public FieldSelector withoutField(Field field) { return new FieldSelector(bitmap & ~field.getBit()); } private  FieldSelector(int bitmap); int getBitmap(); void ifSelectedRun(Field field, Runnable runnable); boolean isSelected(Field field); FieldSelector withoutField(Field field); static FieldSelector fromBitmap(int bitmap); static FieldSelector fromFields(List<String> fields); static final FieldSelector DEFAULT_FIELDS; static final FieldSelector NO_FIELDS; static final FieldSelector ALL_FIELDS; }