@Test public void shouldConvertFieldNameToInitials() { assertEquals("bW", AttributeCompressionStrategy.getInitials("badgerWoodland")); assertEquals("bWO", AttributeCompressionStrategy.getInitials("badgerWOodland")); assertEquals("bWOL", AttributeCompressionStrategy.getInitials("badgerWOodLand")); }
public static String getInitials(String name) { if (name == null) { throw new IllegalArgumentException("Name was null"); } StringBuilder r = new StringBuilder(); boolean start = true; for (int ii = 0; ii < name.length(); ii++) { char c = name.charAt(ii); if (start) { r.append(c); start = false; continue; } if (Character.isUpperCase(c)) { r.append(c); } } return r.toString(); }
AttributeCompressionStrategy implements BlobStrategy { public static String getInitials(String name) { if (name == null) { throw new IllegalArgumentException("Name was null"); } StringBuilder r = new StringBuilder(); boolean start = true; for (int ii = 0; ii < name.length(); ii++) { char c = name.charAt(ii); if (start) { r.append(c); start = false; continue; } if (Character.isUpperCase(c)) { r.append(c); } } return r.toString(); } }
AttributeCompressionStrategy implements BlobStrategy { public static String getInitials(String name) { if (name == null) { throw new IllegalArgumentException("Name was null"); } StringBuilder r = new StringBuilder(); boolean start = true; for (int ii = 0; ii < name.length(); ii++) { char c = name.charAt(ii); if (start) { r.append(c); start = false; continue; } if (Character.isUpperCase(c)) { r.append(c); } } return r.toString(); } @Inject  AttributeCompressionStrategy(TokenBlobUtils blobUtils); }
AttributeCompressionStrategy implements BlobStrategy { public static String getInitials(String name) { if (name == null) { throw new IllegalArgumentException("Name was null"); } StringBuilder r = new StringBuilder(); boolean start = true; for (int ii = 0; ii < name.length(); ii++) { char c = name.charAt(ii); if (start) { r.append(c); start = false; continue; } if (Character.isUpperCase(c)) { r.append(c); } } return r.toString(); } @Inject  AttributeCompressionStrategy(TokenBlobUtils blobUtils); void perform(Token token); void reverse(Token token); static String getInitials(String name); static Collection<Field> getAllValidFields(Class c); }
AttributeCompressionStrategy implements BlobStrategy { public static String getInitials(String name) { if (name == null) { throw new IllegalArgumentException("Name was null"); } StringBuilder r = new StringBuilder(); boolean start = true; for (int ii = 0; ii < name.length(); ii++) { char c = name.charAt(ii); if (start) { r.append(c); start = false; continue; } if (Character.isUpperCase(c)) { r.append(c); } } return r.toString(); } @Inject  AttributeCompressionStrategy(TokenBlobUtils blobUtils); void perform(Token token); void reverse(Token token); static String getInitials(String name); static Collection<Field> getAllValidFields(Class c);  }