target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test(expected = CommsRouterException.class) public void testSkillUnexpectedValue() throws CommsRouterException { AttributeGroupDto attributeGroupDto = new AttributeGroupDto(); attributeGroupDto.add("isTechnical", "yes"); skillValidator.validate(attributeGroupDto, routerRef); }
public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
@Test(expected = CommsRouterException.class) public void testSkillBadStringValue() throws CommsRouterException { AttributeGroupDto attributeGroupDto = new AttributeGroupDto(); attributeGroupDto.add("nameWithRegex", "suzie5"); skillValidator.validate(attributeGroupDto, routerRef); }
public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
@Test(expected = CommsRouterException.class) public void testSkillBadEnumValue() throws CommsRouterException { AttributeGroupDto attributeGroupDto = new AttributeGroupDto(); attributeGroupDto.add("language", "pl"); skillValidator.validate(attributeGroupDto, routerRef); }
public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
@Test(expected = CommsRouterException.class) public void testSkillBadNumberValue() throws CommsRouterException { AttributeGroupDto attributeGroupDto = new AttributeGroupDto(); attributeGroupDto.add("ageWithBoundary", "5"); skillValidator.validate(attributeGroupDto, routerRef); }
public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } }
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
SkillValidator { public void validate(AttributeGroupDto capabilities, String routerRef) throws CommsRouterException { if (capabilities != null) { for (Map.Entry<String, AttributeValueDto> capability : capabilities.entrySet()) { validateCapability(capability.getKey(), capability.getValue(), routerRef); } } } SkillValida...
@Test public void testGetAttributeType() { AttributeType actual; AttributeDomainDefinition def; def = new AttributeDomainDefinition(); def.setEnumValue("enum-value"); actual = AttributeDomainMapper.getAttributeType(def); assertEquals(AttributeType.enumeration, actual); def = new AttributeDomainDefinition(); def.setBoun...
public static AttributeType getAttributeType(AttributeDomainDefinition jpa) { if (jpa.getEnumValue() != null) { assert jpa.getBoundary() == null && jpa.getInclusive() == null && jpa.getRegex() == null; return AttributeType.enumeration; } if (jpa.getBoundary() != null) { assert jpa.getEnumValue() == null && jpa.getRegex...
AttributeDomainMapper { public static AttributeType getAttributeType(AttributeDomainDefinition jpa) { if (jpa.getEnumValue() != null) { assert jpa.getBoundary() == null && jpa.getInclusive() == null && jpa.getRegex() == null; return AttributeType.enumeration; } if (jpa.getBoundary() != null) { assert jpa.getEnumValue()...
AttributeDomainMapper { public static AttributeType getAttributeType(AttributeDomainDefinition jpa) { if (jpa.getEnumValue() != null) { assert jpa.getBoundary() == null && jpa.getInclusive() == null && jpa.getRegex() == null; return AttributeType.enumeration; } if (jpa.getBoundary() != null) { assert jpa.getEnumValue()...
AttributeDomainMapper { public static AttributeType getAttributeType(AttributeDomainDefinition jpa) { if (jpa.getEnumValue() != null) { assert jpa.getBoundary() == null && jpa.getInclusive() == null && jpa.getRegex() == null; return AttributeType.enumeration; } if (jpa.getBoundary() != null) { assert jpa.getEnumValue()...
AttributeDomainMapper { public static AttributeType getAttributeType(AttributeDomainDefinition jpa) { if (jpa.getEnumValue() != null) { assert jpa.getBoundary() == null && jpa.getInclusive() == null && jpa.getRegex() == null; return AttributeType.enumeration; } if (jpa.getBoundary() != null) { assert jpa.getEnumValue()...
@Test public void equalsTest() throws Exception { assertTrue("The same object", planP1R1.equals(planP1R1)); assertTrue("Diff object", planP1R1.equals(planP1R1new)); assertFalse("Should not equals", planP1R1.equals(planP1R2)); assertFalse("Diff class", planP1R1.equals(task)); assertFalse("Diff class", planP1R1.equals(ne...
@Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { RouterObject routerObject = (RouterObject) object; return Objects.equals(getRouter(), routerObject.getRouter()); } return false; }
RouterObject extends ApiObject { @Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { RouterObject routerObject = (RouterObject) object; return Objects.equals(getRouter(), routerObject.getRouter()); } return false; } }
RouterObject extends ApiObject { @Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { RouterObject routerObject = (RouterObject) object; return Objects.equals(getRouter(), routerObject.getRouter()); } return false; } RouterObject(); RouterObject(RouterObject rhs); Rout...
RouterObject extends ApiObject { @Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { RouterObject routerObject = (RouterObject) object; return Objects.equals(getRouter(), routerObject.getRouter()); } return false; } RouterObject(); RouterObject(RouterObject rhs); Rout...
RouterObject extends ApiObject { @Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { RouterObject routerObject = (RouterObject) object; return Objects.equals(getRouter(), routerObject.getRouter()); } return false; } RouterObject(); RouterObject(RouterObject rhs); Rout...
@Test(expected = BadValueException.class) public void testValidateLowAndHighEqualLowNotInclusive() throws Exception { NumberInterval instance = new NumberInterval( new NumberIntervalBoundary(10.0), new NumberIntervalBoundary(10.0, true) ); instance.validate(); }
public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); if (compareLowHig...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
@Test public void hashCodeTest() throws Exception { assertEquals("The same object", planP1R1.hashCode(), planP1R1.hashCode()); assertEquals("Diff object", planP1R1.hashCode(), planP1R1new.hashCode()); assertNotEquals("Should not equals", planP1R1.hashCode(), planP1R2.hashCode()); assertNotEquals("Diff class", planP1R1....
@Override public int hashCode() { return Objects.hash(getRef(), getRouter(), getVersion(), getClass()); }
RouterObject extends ApiObject { @Override public int hashCode() { return Objects.hash(getRef(), getRouter(), getVersion(), getClass()); } }
RouterObject extends ApiObject { @Override public int hashCode() { return Objects.hash(getRef(), getRouter(), getVersion(), getClass()); } RouterObject(); RouterObject(RouterObject rhs); RouterObject(String id); }
RouterObject extends ApiObject { @Override public int hashCode() { return Objects.hash(getRef(), getRouter(), getVersion(), getClass()); } RouterObject(); RouterObject(RouterObject rhs); RouterObject(String id); Router getRouter(); void setRouter(Router router); @Override String toString(); @Override boolean equals(O...
RouterObject extends ApiObject { @Override public int hashCode() { return Objects.hash(getRef(), getRouter(), getVersion(), getClass()); } RouterObject(); RouterObject(RouterObject rhs); RouterObject(String id); Router getRouter(); void setRouter(Router router); @Override String toString(); @Override boolean equals(O...
@Test(expected = BadValueException.class) public void testValidateLowAndHighEqualHighNotInclusive() throws Exception { NumberInterval instance = new NumberInterval( new NumberIntervalBoundary(10.0, true), new NumberIntervalBoundary(10.0, false) ); instance.validate(); }
public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); if (compareLowHig...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
NumberInterval { public void validate() throws BadValueException { if (low == null) { throw new BadValueException("NumberInterval.low is required"); } if (high == null) { throw new BadValueException("NumberInterval.high is required"); } low.validate(); high.validate(); int compareLowHigh = low.compareBoundaryTo(high); ...
@Test public void step01_ClientCreateUserTest() { StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); StatusProto.ResponseStatus status = client.createUser("paraflow", "paraflow"); assertEquals(expect, status); }
public StatusProto.ResponseStatus createUser(String userName, String password) { StatusProto.ResponseStatus status; MetaProto.UserParam user = MetaProto.UserParam.newBuilder() .setUserName(userName) .setPassword(password) .build(); try { status = metaBlockingStub.createUser(user); } catch (StatusRuntimeException e) { l...
MetaClient { public StatusProto.ResponseStatus createUser(String userName, String password) { StatusProto.ResponseStatus status; MetaProto.UserParam user = MetaProto.UserParam.newBuilder() .setUserName(userName) .setPassword(password) .build(); try { status = metaBlockingStub.createUser(user); } catch (StatusRuntimeExc...
MetaClient { public StatusProto.ResponseStatus createUser(String userName, String password) { StatusProto.ResponseStatus status; MetaProto.UserParam user = MetaProto.UserParam.newBuilder() .setUserName(userName) .setPassword(password) .build(); try { status = metaBlockingStub.createUser(user); } catch (StatusRuntimeExc...
MetaClient { public StatusProto.ResponseStatus createUser(String userName, String password) { StatusProto.ResponseStatus status; MetaProto.UserParam user = MetaProto.UserParam.newBuilder() .setUserName(userName) .setPassword(password) .build(); try { status = metaBlockingStub.createUser(user); } catch (StatusRuntimeExc...
MetaClient { public StatusProto.ResponseStatus createUser(String userName, String password) { StatusProto.ResponseStatus status; MetaProto.UserParam user = MetaProto.UserParam.newBuilder() .setUserName(userName) .setPassword(password) .build(); try { status = metaBlockingStub.createUser(user); } catch (StatusRuntimeExc...
@Test public void step02_ClientCreateDatabaseTest() { StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); StatusProto.ResponseStatus status = client.createDatabase("test", "hdfs: assertEquals(expect, status); }
public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); }
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } }
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } MetaClient(String host, int port); private MetaClient(ManagedChannel channel); }
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } MetaClient(String host, int port); private MetaClient(ManagedChannel channel); void shutdown(int pollSecs); void shutdownNow(); StatusProto.ResponseStatus createUser(String use...
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } MetaClient(String host, int port); private MetaClient(ManagedChannel channel); void shutdown(int pollSecs); void shutdownNow(); StatusProto.ResponseStatus createUser(String use...
@Test public void step03_ClientCreateDatabase2Test() { StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); StatusProto.ResponseStatus status = client.createDatabase("regular", "paraflow"); assertEquals(expect, status); }
public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); }
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } }
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } MetaClient(String host, int port); private MetaClient(ManagedChannel channel); }
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } MetaClient(String host, int port); private MetaClient(ManagedChannel channel); void shutdown(int pollSecs); void shutdownNow(); StatusProto.ResponseStatus createUser(String use...
MetaClient { public StatusProto.ResponseStatus createDatabase(String dbName) { return createDatabase(dbName, MetaConstants.defaultUserName); } MetaClient(String host, int port); private MetaClient(ManagedChannel channel); void shutdown(int pollSecs); void shutdownNow(); StatusProto.ResponseStatus createUser(String use...
@Test public void step07_ClientCreateRegularTableTest() { StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); ArrayList<String> columnName = new ArrayList<>(); columnName.add("smell"); columnName.add("color"); columnName.add("feel");...
public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); }
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } }
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } MetaClient(String host, int port); private MetaClient(Manage...
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } MetaClient(String host, int port); private MetaClient(Manage...
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } MetaClient(String host, int port); private MetaClient(Manage...
@Test public void step08_ClientCreateFiberTableTest() { StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); ArrayList<String> columnName = new ArrayList<>(); columnName.add("id"); columnName.add("color"); columnName.add("feel"); colu...
public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); }
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } }
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } MetaClient(String host, int port); private MetaClient(Manage...
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } MetaClient(String host, int port); private MetaClient(Manage...
MetaClient { public StatusProto.ResponseStatus createTable( String dbName, String tblName, String storageFormatName, List<String> columnName, List<String> dataType) { return createTable(dbName, tblName, storageFormatName, -1, "", -1, columnName, dataType); } MetaClient(String host, int port); private MetaClient(Manage...
@Test public void step10_ClientListDatabasesTest() { MetaProto.StringListType expect = MetaProto.StringListType.newBuilder().addStr("test").addStr("regular").build(); MetaProto.StringListType stringList = client.listDatabases(); assertEquals(expect, stringList); }
public MetaProto.StringListType listDatabases() { MetaProto.NoneType none = MetaProto.NoneType.newBuilder().build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listDatabases(none); } catch (StatusRuntimeException e) { logger.warn("RPC failed: " + e.getStatus()); stringList = MetaProto.Stri...
MetaClient { public MetaProto.StringListType listDatabases() { MetaProto.NoneType none = MetaProto.NoneType.newBuilder().build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listDatabases(none); } catch (StatusRuntimeException e) { logger.warn("RPC failed: " + e.getStatus()); stringList = M...
MetaClient { public MetaProto.StringListType listDatabases() { MetaProto.NoneType none = MetaProto.NoneType.newBuilder().build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listDatabases(none); } catch (StatusRuntimeException e) { logger.warn("RPC failed: " + e.getStatus()); stringList = M...
MetaClient { public MetaProto.StringListType listDatabases() { MetaProto.NoneType none = MetaProto.NoneType.newBuilder().build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listDatabases(none); } catch (StatusRuntimeException e) { logger.warn("RPC failed: " + e.getStatus()); stringList = M...
MetaClient { public MetaProto.StringListType listDatabases() { MetaProto.NoneType none = MetaProto.NoneType.newBuilder().build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listDatabases(none); } catch (StatusRuntimeException e) { logger.warn("RPC failed: " + e.getStatus()); stringList = M...
@Test public void step11_ClientListTableTest() { MetaProto.StringListType expect = MetaProto.StringListType.newBuilder().addStr("grip").build(); MetaProto.StringListType stringList = client.listTables("test"); assertEquals(expect, stringList); }
public MetaProto.StringListType listTables(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listTables(databaseName); } catch (StatusRuntimeException e) { logger.warn("RPC fail...
MetaClient { public MetaProto.StringListType listTables(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listTables(databaseName); } catch (StatusRuntimeException e) { logger.w...
MetaClient { public MetaProto.StringListType listTables(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listTables(databaseName); } catch (StatusRuntimeException e) { logger.w...
MetaClient { public MetaProto.StringListType listTables(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listTables(databaseName); } catch (StatusRuntimeException e) { logger.w...
MetaClient { public MetaProto.StringListType listTables(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.StringListType stringList; try { stringList = metaBlockingStub.listTables(databaseName); } catch (StatusRuntimeException e) { logger.w...
@Test public void step33_ClientDeleteTableTest() { StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); StatusProto.ResponseStatus status = client.deleteTable("regular", "noodles"); assertEquals(expect, status); }
public StatusProto.ResponseStatus deleteTable(String dbName, String tblName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.TblNameParam tableName = MetaProto.TblNameParam.newBuilder() .setTable(tblName) .build(); MetaProto.DbTblParam databaseTable = M...
MetaClient { public StatusProto.ResponseStatus deleteTable(String dbName, String tblName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.TblNameParam tableName = MetaProto.TblNameParam.newBuilder() .setTable(tblName) .build(); MetaProto.DbTblParam data...
MetaClient { public StatusProto.ResponseStatus deleteTable(String dbName, String tblName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.TblNameParam tableName = MetaProto.TblNameParam.newBuilder() .setTable(tblName) .build(); MetaProto.DbTblParam data...
MetaClient { public StatusProto.ResponseStatus deleteTable(String dbName, String tblName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.TblNameParam tableName = MetaProto.TblNameParam.newBuilder() .setTable(tblName) .build(); MetaProto.DbTblParam data...
MetaClient { public StatusProto.ResponseStatus deleteTable(String dbName, String tblName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); MetaProto.TblNameParam tableName = MetaProto.TblNameParam.newBuilder() .setTable(tblName) .build(); MetaProto.DbTblParam data...
@Test public void step34_ClientDeleteDatabaseTest() { MetaClient client = new MetaClient("127.0.0.1", 10012); StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); StatusProto.ResponseStatus status = client.deleteDatabase("regular"); a...
public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logger.warn("RPC ...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
@Test public void step35_ClientDeleteDatabase2Test() { MetaClient client = new MetaClient("127.0.0.1", 10012); StatusProto.ResponseStatus expect = StatusProto.ResponseStatus.newBuilder().setStatus(StatusProto.ResponseStatus.State.STATUS_OK).build(); StatusProto.ResponseStatus status = client.deleteDatabase("test"); ass...
public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logger.warn("RPC ...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
MetaClient { public StatusProto.ResponseStatus deleteDatabase(String dbName) { MetaProto.DbNameParam databaseName = MetaProto.DbNameParam.newBuilder() .setDatabase(dbName) .build(); StatusProto.ResponseStatus status; try { status = metaBlockingStub.deleteDatabase(databaseName); } catch (StatusRuntimeException e) { logg...
@Test public void semaphoreTest() throws Exception { AdjustableSemaphore semaphore = new AdjustableSemaphore(5); for (int i = 0; i < 20; i++) { semaphore.tryAcquire(); } Assert.assertEquals(0, semaphore.availablePermits()); semaphore.setMaxPermits(2); Assert.assertEquals(-3, semaphore.availablePermits()); semaphore.set...
public synchronized void setMaxPermits(int maxPermits) { if (maxPermits < 1) { throw new IllegalArgumentException("Semaphore size(" + maxPermits + ") must be at least 1"); } int delta = maxPermits - this.maxPermits; if (delta == 0) { return; } else if (delta > 0) { super.release(delta); } else { delta *= -1; super.redu...
AdjustableSemaphore extends Semaphore { public synchronized void setMaxPermits(int maxPermits) { if (maxPermits < 1) { throw new IllegalArgumentException("Semaphore size(" + maxPermits + ") must be at least 1"); } int delta = maxPermits - this.maxPermits; if (delta == 0) { return; } else if (delta > 0) { super.release(...
AdjustableSemaphore extends Semaphore { public synchronized void setMaxPermits(int maxPermits) { if (maxPermits < 1) { throw new IllegalArgumentException("Semaphore size(" + maxPermits + ") must be at least 1"); } int delta = maxPermits - this.maxPermits; if (delta == 0) { return; } else if (delta > 0) { super.release(...
AdjustableSemaphore extends Semaphore { public synchronized void setMaxPermits(int maxPermits) { if (maxPermits < 1) { throw new IllegalArgumentException("Semaphore size(" + maxPermits + ") must be at least 1"); } int delta = maxPermits - this.maxPermits; if (delta == 0) { return; } else if (delta > 0) { super.release(...
AdjustableSemaphore extends Semaphore { public synchronized void setMaxPermits(int maxPermits) { if (maxPermits < 1) { throw new IllegalArgumentException("Semaphore size(" + maxPermits + ") must be at least 1"); } int delta = maxPermits - this.maxPermits; if (delta == 0) { return; } else if (delta > 0) { super.release(...
@Test public void testWithWaitStrategy() throws ExecutionException, RetryException { Callable<Boolean> callable = notNullAfter5Attempts(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .withWaitStrategy(WaitStrategies.fixedWait(50L, TimeUnit.MILLISECONDS)) .retryIfResult(Predicates.<Boolean>isNull()) ...
public RetryerBuilder<V> withWaitStrategy(WaitStrategy waitStrategy) throws IllegalStateException { Preconditions.checkNotNull(waitStrategy, "waitStrategy may not be null"); Preconditions.checkState(this.waitStrategy == null, "a wait strategy has already been set %s", this.waitStrategy); this.waitStrategy = waitStrateg...
RetryerBuilder { public RetryerBuilder<V> withWaitStrategy(WaitStrategy waitStrategy) throws IllegalStateException { Preconditions.checkNotNull(waitStrategy, "waitStrategy may not be null"); Preconditions.checkState(this.waitStrategy == null, "a wait strategy has already been set %s", this.waitStrategy); this.waitStrat...
RetryerBuilder { public RetryerBuilder<V> withWaitStrategy(WaitStrategy waitStrategy) throws IllegalStateException { Preconditions.checkNotNull(waitStrategy, "waitStrategy may not be null"); Preconditions.checkState(this.waitStrategy == null, "a wait strategy has already been set %s", this.waitStrategy); this.waitStrat...
RetryerBuilder { public RetryerBuilder<V> withWaitStrategy(WaitStrategy waitStrategy) throws IllegalStateException { Preconditions.checkNotNull(waitStrategy, "waitStrategy may not be null"); Preconditions.checkState(this.waitStrategy == null, "a wait strategy has already been set %s", this.waitStrategy); this.waitStrat...
RetryerBuilder { public RetryerBuilder<V> withWaitStrategy(WaitStrategy waitStrategy) throws IllegalStateException { Preconditions.checkNotNull(waitStrategy, "waitStrategy may not be null"); Preconditions.checkState(this.waitStrategy == null, "a wait strategy has already been set %s", this.waitStrategy); this.waitStrat...
@Test public void testWithStopStrategy() throws ExecutionException { Callable<Boolean> callable = notNullAfter5Attempts(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .withStopStrategy(StopStrategies.stopAfterAttempt(3)) .retryIfResult(Predicates.<Boolean>isNull()) .build(); try { retryer.call(calla...
public RetryerBuilder<V> withStopStrategy(StopStrategy stopStrategy) throws IllegalStateException { Preconditions.checkNotNull(stopStrategy, "stopStrategy may not be null"); Preconditions.checkState(this.stopStrategy == null, "a stop strategy has already been set %s", this.stopStrategy); this.stopStrategy = stopStrateg...
RetryerBuilder { public RetryerBuilder<V> withStopStrategy(StopStrategy stopStrategy) throws IllegalStateException { Preconditions.checkNotNull(stopStrategy, "stopStrategy may not be null"); Preconditions.checkState(this.stopStrategy == null, "a stop strategy has already been set %s", this.stopStrategy); this.stopStrat...
RetryerBuilder { public RetryerBuilder<V> withStopStrategy(StopStrategy stopStrategy) throws IllegalStateException { Preconditions.checkNotNull(stopStrategy, "stopStrategy may not be null"); Preconditions.checkState(this.stopStrategy == null, "a stop strategy has already been set %s", this.stopStrategy); this.stopStrat...
RetryerBuilder { public RetryerBuilder<V> withStopStrategy(StopStrategy stopStrategy) throws IllegalStateException { Preconditions.checkNotNull(stopStrategy, "stopStrategy may not be null"); Preconditions.checkState(this.stopStrategy == null, "a stop strategy has already been set %s", this.stopStrategy); this.stopStrat...
RetryerBuilder { public RetryerBuilder<V> withStopStrategy(StopStrategy stopStrategy) throws IllegalStateException { Preconditions.checkNotNull(stopStrategy, "stopStrategy may not be null"); Preconditions.checkState(this.stopStrategy == null, "a stop strategy has already been set %s", this.stopStrategy); this.stopStrat...
@Test public void testWithBlockStrategy() throws ExecutionException, RetryException { Callable<Boolean> callable = notNullAfter5Attempts(); final AtomicInteger counter = new AtomicInteger(); BlockStrategy blockStrategy = new BlockStrategy() { @Override public void block(long sleepTime) throws InterruptedException { cou...
public RetryerBuilder<V> withBlockStrategy(BlockStrategy blockStrategy) throws IllegalStateException { Preconditions.checkNotNull(blockStrategy, "blockStrategy may not be null"); Preconditions.checkState(this.blockStrategy == null, "a block strategy has already been set %s", this.blockStrategy); this.blockStrategy = bl...
RetryerBuilder { public RetryerBuilder<V> withBlockStrategy(BlockStrategy blockStrategy) throws IllegalStateException { Preconditions.checkNotNull(blockStrategy, "blockStrategy may not be null"); Preconditions.checkState(this.blockStrategy == null, "a block strategy has already been set %s", this.blockStrategy); this.b...
RetryerBuilder { public RetryerBuilder<V> withBlockStrategy(BlockStrategy blockStrategy) throws IllegalStateException { Preconditions.checkNotNull(blockStrategy, "blockStrategy may not be null"); Preconditions.checkState(this.blockStrategy == null, "a block strategy has already been set %s", this.blockStrategy); this.b...
RetryerBuilder { public RetryerBuilder<V> withBlockStrategy(BlockStrategy blockStrategy) throws IllegalStateException { Preconditions.checkNotNull(blockStrategy, "blockStrategy may not be null"); Preconditions.checkState(this.blockStrategy == null, "a block strategy has already been set %s", this.blockStrategy); this.b...
RetryerBuilder { public RetryerBuilder<V> withBlockStrategy(BlockStrategy blockStrategy) throws IllegalStateException { Preconditions.checkNotNull(blockStrategy, "blockStrategy may not be null"); Preconditions.checkState(this.blockStrategy == null, "a block strategy has already been set %s", this.blockStrategy); this.b...
@Test public void testRetryIfException() throws ExecutionException, RetryException { Callable<Boolean> callable = noIOExceptionAfter5Attempts(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .retryIfException() .build(); boolean result = retryer.call(callable); assertTrue(result); callable = noIOExcep...
public RetryerBuilder<V> retryIfException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(Exception.class)); return this; }
RetryerBuilder { public RetryerBuilder<V> retryIfException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(Exception.class)); return this; } }
RetryerBuilder { public RetryerBuilder<V> retryIfException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(Exception.class)); return this; } private RetryerBuilder(); }
RetryerBuilder { public RetryerBuilder<V> retryIfException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(Exception.class)); return this; } private RetryerBuilder(); static RetryerBuilder<V> newBuilder(); RetryerBuilder<V> withRetryListener(RetryListener listener); RetryerBui...
RetryerBuilder { public RetryerBuilder<V> retryIfException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(Exception.class)); return this; } private RetryerBuilder(); static RetryerBuilder<V> newBuilder(); RetryerBuilder<V> withRetryListener(RetryListener listener); RetryerBui...
@Test public void testRetryIfRuntimeException() throws ExecutionException, RetryException { Callable<Boolean> callable = noIOExceptionAfter5Attempts(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .retryIfRuntimeException() .build(); try { retryer.call(callable); fail("ExecutionException expected"); ...
public RetryerBuilder<V> retryIfRuntimeException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class)); return this; }
RetryerBuilder { public RetryerBuilder<V> retryIfRuntimeException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class)); return this; } }
RetryerBuilder { public RetryerBuilder<V> retryIfRuntimeException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class)); return this; } private RetryerBuilder(); }
RetryerBuilder { public RetryerBuilder<V> retryIfRuntimeException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class)); return this; } private RetryerBuilder(); static RetryerBuilder<V> newBuilder(); RetryerBuilder<V> withRetryListener(RetryListener listene...
RetryerBuilder { public RetryerBuilder<V> retryIfRuntimeException() { rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class)); return this; } private RetryerBuilder(); static RetryerBuilder<V> newBuilder(); RetryerBuilder<V> withRetryListener(RetryListener listene...
@Test public void testRetryIfExceptionOfType() throws RetryException, ExecutionException { Callable<Boolean> callable = noIOExceptionAfter5Attempts(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .retryIfExceptionOfType(IOException.class) .build(); assertTrue(retryer.call(callable)); callable = noIll...
public RetryerBuilder<V> retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) { Preconditions.checkNotNull(exceptionClass, "exceptionClass may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(exceptionClass)); return this; }
RetryerBuilder { public RetryerBuilder<V> retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) { Preconditions.checkNotNull(exceptionClass, "exceptionClass may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(exceptionClass)); return this; } }
RetryerBuilder { public RetryerBuilder<V> retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) { Preconditions.checkNotNull(exceptionClass, "exceptionClass may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(exceptionClass)); return this; } private Retr...
RetryerBuilder { public RetryerBuilder<V> retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) { Preconditions.checkNotNull(exceptionClass, "exceptionClass may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(exceptionClass)); return this; } private Retr...
RetryerBuilder { public RetryerBuilder<V> retryIfExceptionOfType(Class<? extends Throwable> exceptionClass) { Preconditions.checkNotNull(exceptionClass, "exceptionClass may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(exceptionClass)); return this; } private Retr...
@Test public void testRetryIfResult() throws ExecutionException, RetryException { Callable<Boolean> callable = notNullAfter5Attempts(); Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() .retryIfResult(Predicates.<Boolean>isNull()) .build(); assertTrue(retryer.call(callable)); callable = notNullAfter5Attem...
public RetryerBuilder<V> retryIfResult(Predicate<V> resultPredicate) { Preconditions.checkNotNull(resultPredicate, "resultPredicate may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ResultPredicate<V>(resultPredicate)); return this; }
RetryerBuilder { public RetryerBuilder<V> retryIfResult(Predicate<V> resultPredicate) { Preconditions.checkNotNull(resultPredicate, "resultPredicate may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ResultPredicate<V>(resultPredicate)); return this; } }
RetryerBuilder { public RetryerBuilder<V> retryIfResult(Predicate<V> resultPredicate) { Preconditions.checkNotNull(resultPredicate, "resultPredicate may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ResultPredicate<V>(resultPredicate)); return this; } private RetryerBuilder(); }
RetryerBuilder { public RetryerBuilder<V> retryIfResult(Predicate<V> resultPredicate) { Preconditions.checkNotNull(resultPredicate, "resultPredicate may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ResultPredicate<V>(resultPredicate)); return this; } private RetryerBuilder(); static Retrye...
RetryerBuilder { public RetryerBuilder<V> retryIfResult(Predicate<V> resultPredicate) { Preconditions.checkNotNull(resultPredicate, "resultPredicate may not be null"); rejectionPredicate = Predicates.or(rejectionPredicate, new ResultPredicate<V>(resultPredicate)); return this; } private RetryerBuilder(); static Retrye...
@Test public void fixedTimeLimitTest() { try { AttemptTimeLimiters.fixedTimeLimit(3000, TimeUnit.MILLISECONDS).call(new Callable<Object>() { @Override public Object call() throws Exception { Thread.sleep(2000); return null; } }); } catch (Exception e) { e.printStackTrace(); } }
public static <V> AttemptTimeLimiter<V> fixedTimeLimit(long duration, TimeUnit timeUnit) { Preconditions.checkNotNull(timeUnit); return new FixedAttemptTimeLimit<V>(duration, timeUnit); }
AttemptTimeLimiters { public static <V> AttemptTimeLimiter<V> fixedTimeLimit(long duration, TimeUnit timeUnit) { Preconditions.checkNotNull(timeUnit); return new FixedAttemptTimeLimit<V>(duration, timeUnit); } }
AttemptTimeLimiters { public static <V> AttemptTimeLimiter<V> fixedTimeLimit(long duration, TimeUnit timeUnit) { Preconditions.checkNotNull(timeUnit); return new FixedAttemptTimeLimit<V>(duration, timeUnit); } private AttemptTimeLimiters(); }
AttemptTimeLimiters { public static <V> AttemptTimeLimiter<V> fixedTimeLimit(long duration, TimeUnit timeUnit) { Preconditions.checkNotNull(timeUnit); return new FixedAttemptTimeLimit<V>(duration, timeUnit); } private AttemptTimeLimiters(); static AttemptTimeLimiter<V> noTimeLimit(); static AttemptTimeLimiter<V> fixed...
AttemptTimeLimiters { public static <V> AttemptTimeLimiter<V> fixedTimeLimit(long duration, TimeUnit timeUnit) { Preconditions.checkNotNull(timeUnit); return new FixedAttemptTimeLimit<V>(duration, timeUnit); } private AttemptTimeLimiters(); static AttemptTimeLimiter<V> noTimeLimit(); static AttemptTimeLimiter<V> fixed...
@Test(expected = CircuitBreakerOpenException.class) public void testOpen() { for (int i = 0; i < 6; i++) { try { demoService.getUuid(2); } catch (Exception e) { } } demoService.getUuid(1); }
public void open() { lastOpenedTime = System.currentTimeMillis(); state = CircuitBreakerState.OPEN; logger.debug("circuit open,key:{}", name); }
CircuitBreaker { public void open() { lastOpenedTime = System.currentTimeMillis(); state = CircuitBreakerState.OPEN; logger.debug("circuit open,key:{}", name); } }
CircuitBreaker { public void open() { lastOpenedTime = System.currentTimeMillis(); state = CircuitBreakerState.OPEN; logger.debug("circuit open,key:{}", name); } CircuitBreaker(String name, CircuitBreakerConfig config); }
CircuitBreaker { public void open() { lastOpenedTime = System.currentTimeMillis(); state = CircuitBreakerState.OPEN; logger.debug("circuit open,key:{}", name); } CircuitBreaker(String name, CircuitBreakerConfig config); boolean isOpen(); boolean isHalfOpen(); boolean isClosed(); void open(); void openHalf(); void close...
CircuitBreaker { public void open() { lastOpenedTime = System.currentTimeMillis(); state = CircuitBreakerState.OPEN; logger.debug("circuit open,key:{}", name); } CircuitBreaker(String name, CircuitBreakerConfig config); boolean isOpen(); boolean isHalfOpen(); boolean isClosed(); void open(); void openHalf(); void close...
@Test public void parseJavaVersion() { JavaVersion.Version parsedVersion = JavaVersion.parseVersion(version); assertEquals("Major version mismatch", expected.major, parsedVersion.major); assertEquals("Minor version mismatch", expected.minor, parsedVersion.minor); }
static Version parseVersion(String version) { if (version.startsWith("1.")) { String[] versions = version.split("\\."); if (versions.length <= 1) { throw new IllegalStateException("Invalid Java version: " + version); } return new Version(1, Integer.parseInt(versions[1])); } else { final Matcher matcher = JDK9_AND_HIGHE...
JavaVersion { static Version parseVersion(String version) { if (version.startsWith("1.")) { String[] versions = version.split("\\."); if (versions.length <= 1) { throw new IllegalStateException("Invalid Java version: " + version); } return new Version(1, Integer.parseInt(versions[1])); } else { final Matcher matcher = ...
JavaVersion { static Version parseVersion(String version) { if (version.startsWith("1.")) { String[] versions = version.split("\\."); if (versions.length <= 1) { throw new IllegalStateException("Invalid Java version: " + version); } return new Version(1, Integer.parseInt(versions[1])); } else { final Matcher matcher = ...
JavaVersion { static Version parseVersion(String version) { if (version.startsWith("1.")) { String[] versions = version.split("\\."); if (versions.length <= 1) { throw new IllegalStateException("Invalid Java version: " + version); } return new Version(1, Integer.parseInt(versions[1])); } else { final Matcher matcher = ...
JavaVersion { static Version parseVersion(String version) { if (version.startsWith("1.")) { String[] versions = version.split("\\."); if (versions.length <= 1) { throw new IllegalStateException("Invalid Java version: " + version); } return new Version(1, Integer.parseInt(versions[1])); } else { final Matcher matcher = ...
@Test public void testUnmarshal() { assertEquals(new File("/tmp/Atomic"), BINDING.unmarshal("/tmp/Atomic")); }
@Override public File unmarshal(String object) { return new File(object); }
FileStringBinding extends AbstractStringBinding<File> implements Binding<File, String> { @Override public File unmarshal(String object) { return new File(object); } }
FileStringBinding extends AbstractStringBinding<File> implements Binding<File, String> { @Override public File unmarshal(String object) { return new File(object); } }
FileStringBinding extends AbstractStringBinding<File> implements Binding<File, String> { @Override public File unmarshal(String object) { return new File(object); } @Override File unmarshal(String object); Class<File> getBoundClass(); }
FileStringBinding extends AbstractStringBinding<File> implements Binding<File, String> { @Override public File unmarshal(String object) { return new File(object); } @Override File unmarshal(String object); Class<File> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new StringBuilder("Hello World").toString(), BINDING.unmarshal("Hello World").toString()); }
@Override public StringBuilder unmarshal(String object) { return new StringBuilder(object); }
StringBuilderStringBinding extends AbstractStringBinding<StringBuilder> implements Binding<StringBuilder, String> { @Override public StringBuilder unmarshal(String object) { return new StringBuilder(object); } }
StringBuilderStringBinding extends AbstractStringBinding<StringBuilder> implements Binding<StringBuilder, String> { @Override public StringBuilder unmarshal(String object) { return new StringBuilder(object); } }
StringBuilderStringBinding extends AbstractStringBinding<StringBuilder> implements Binding<StringBuilder, String> { @Override public StringBuilder unmarshal(String object) { return new StringBuilder(object); } @Override StringBuilder unmarshal(String object); Class<StringBuilder> getBoundClass(); }
StringBuilderStringBinding extends AbstractStringBinding<StringBuilder> implements Binding<StringBuilder, String> { @Override public StringBuilder unmarshal(String object) { return new StringBuilder(object); } @Override StringBuilder unmarshal(String object); Class<StringBuilder> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new StringBuffer("Hello World").toString(), BINDING.unmarshal("Hello World").toString()); }
@Override public StringBuffer unmarshal(String object) { return new StringBuffer(object); }
StringBufferStringBinding extends AbstractStringBinding<StringBuffer> implements Binding<StringBuffer, String> { @Override public StringBuffer unmarshal(String object) { return new StringBuffer(object); } }
StringBufferStringBinding extends AbstractStringBinding<StringBuffer> implements Binding<StringBuffer, String> { @Override public StringBuffer unmarshal(String object) { return new StringBuffer(object); } }
StringBufferStringBinding extends AbstractStringBinding<StringBuffer> implements Binding<StringBuffer, String> { @Override public StringBuffer unmarshal(String object) { return new StringBuffer(object); } @Override StringBuffer unmarshal(String object); Class<StringBuffer> getBoundClass(); }
StringBufferStringBinding extends AbstractStringBinding<StringBuffer> implements Binding<StringBuffer, String> { @Override public StringBuffer unmarshal(String object) { return new StringBuffer(object); } @Override StringBuffer unmarshal(String object); Class<StringBuffer> getBoundClass(); }
@Test public void testUnmarshal(){ assertEquals(URI.create("www.example.com"), BINDING.unmarshal("www.example.com")); }
@Override public URI unmarshal(String object) { return URI.create(object); }
URIStringBinding extends AbstractStringBinding<URI> implements Binding<URI, String> { @Override public URI unmarshal(String object) { return URI.create(object); } }
URIStringBinding extends AbstractStringBinding<URI> implements Binding<URI, String> { @Override public URI unmarshal(String object) { return URI.create(object); } }
URIStringBinding extends AbstractStringBinding<URI> implements Binding<URI, String> { @Override public URI unmarshal(String object) { return URI.create(object); } @Override URI unmarshal(String object); Class<URI> getBoundClass(); }
URIStringBinding extends AbstractStringBinding<URI> implements Binding<URI, String> { @Override public URI unmarshal(String object) { return URI.create(object); } @Override URI unmarshal(String object); Class<URI> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new Double(0).toString(), BINDING.unmarshal("0").toString()); assertEquals(new Double(1).toString(), BINDING.unmarshal("1").toString()); assertEquals(new Double(9223372036854775807D), BINDING.unmarshal(new Double(9.223372036854776E18).toString())); assertEquals(new Doubl...
@Override public Double unmarshal(String object) { return Double.valueOf(Double.parseDouble(object)); }
DoubleStringBinding extends AbstractStringBinding<Double> implements Binding<Double, String> { @Override public Double unmarshal(String object) { return Double.valueOf(Double.parseDouble(object)); } }
DoubleStringBinding extends AbstractStringBinding<Double> implements Binding<Double, String> { @Override public Double unmarshal(String object) { return Double.valueOf(Double.parseDouble(object)); } }
DoubleStringBinding extends AbstractStringBinding<Double> implements Binding<Double, String> { @Override public Double unmarshal(String object) { return Double.valueOf(Double.parseDouble(object)); } @Override Double unmarshal(String object); Class<Double> getBoundClass(); }
DoubleStringBinding extends AbstractStringBinding<Double> implements Binding<Double, String> { @Override public Double unmarshal(String object) { return Double.valueOf(Double.parseDouble(object)); } @Override Double unmarshal(String object); Class<Double> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new BigDecimal(0).toString(), BINDING.unmarshal("0").toString()); assertEquals(new BigDecimal(1).toString(), BINDING.unmarshal("1").toString()); assertEquals(new BigDecimal(9223372036854775807L).toString(), BINDING.unmarshal("" + Long.MAX_VALUE).toString()); assertEquals...
@Override public BigDecimal unmarshal(String object) { return new BigDecimal(object); }
BigDecimalStringBinding extends AbstractStringBinding<BigDecimal> implements Binding<BigDecimal, String> { @Override public BigDecimal unmarshal(String object) { return new BigDecimal(object); } }
BigDecimalStringBinding extends AbstractStringBinding<BigDecimal> implements Binding<BigDecimal, String> { @Override public BigDecimal unmarshal(String object) { return new BigDecimal(object); } }
BigDecimalStringBinding extends AbstractStringBinding<BigDecimal> implements Binding<BigDecimal, String> { @Override public BigDecimal unmarshal(String object) { return new BigDecimal(object); } @Override BigDecimal unmarshal(String object); Class<BigDecimal> getBoundClass(); }
BigDecimalStringBinding extends AbstractStringBinding<BigDecimal> implements Binding<BigDecimal, String> { @Override public BigDecimal unmarshal(String object) { return new BigDecimal(object); } @Override BigDecimal unmarshal(String object); Class<BigDecimal> getBoundClass(); }
@Test public void testUnmarshal() throws MalformedURLException{ assertEquals(new URL("http: }
@Override public URL unmarshal(String object) { try { return new URL(object); } catch (MalformedURLException ex) { throw new IllegalArgumentException(object + " is not a valid URL"); } }
URLStringBinding extends AbstractStringBinding<URL> implements Binding<URL, String> { @Override public URL unmarshal(String object) { try { return new URL(object); } catch (MalformedURLException ex) { throw new IllegalArgumentException(object + " is not a valid URL"); } } }
URLStringBinding extends AbstractStringBinding<URL> implements Binding<URL, String> { @Override public URL unmarshal(String object) { try { return new URL(object); } catch (MalformedURLException ex) { throw new IllegalArgumentException(object + " is not a valid URL"); } } }
URLStringBinding extends AbstractStringBinding<URL> implements Binding<URL, String> { @Override public URL unmarshal(String object) { try { return new URL(object); } catch (MalformedURLException ex) { throw new IllegalArgumentException(object + " is not a valid URL"); } } @Override URL unmarshal(String object); Class<...
URLStringBinding extends AbstractStringBinding<URL> implements Binding<URL, String> { @Override public URL unmarshal(String object) { try { return new URL(object); } catch (MalformedURLException ex) { throw new IllegalArgumentException(object + " is not a valid URL"); } } @Override URL unmarshal(String object); Class<...
@Test public void testUnmarshal() { assertEquals(Boolean.TRUE.toString(), BINDING.unmarshal("true").toString()); assertEquals(Boolean.FALSE.toString(), BINDING.unmarshal("false").toString()); }
@Override public Boolean unmarshal(String object) { return Boolean.valueOf(object); }
BooleanStringBinding extends AbstractStringBinding<Boolean> implements Binding<Boolean, String> { @Override public Boolean unmarshal(String object) { return Boolean.valueOf(object); } }
BooleanStringBinding extends AbstractStringBinding<Boolean> implements Binding<Boolean, String> { @Override public Boolean unmarshal(String object) { return Boolean.valueOf(object); } }
BooleanStringBinding extends AbstractStringBinding<Boolean> implements Binding<Boolean, String> { @Override public Boolean unmarshal(String object) { return Boolean.valueOf(object); } @Override Boolean unmarshal(String object); Class<Boolean> getBoundClass(); }
BooleanStringBinding extends AbstractStringBinding<Boolean> implements Binding<Boolean, String> { @Override public Boolean unmarshal(String object) { return Boolean.valueOf(object); } @Override Boolean unmarshal(String object); Class<Boolean> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new Locale("en"), BINDING.unmarshal("en")); assertEquals(new Locale("en","GB"), BINDING.unmarshal("en_GB")); assertEquals(new Locale("en","GB","ck"), BINDING.unmarshal("en_gb_ck")); }
@Override public Locale unmarshal(String object) { String[] components = object.split("_", 3); final Locale result; if (components.length == 1) { result = new Locale(components[0]); } else if (components.length == 2) { result = new Locale(components[0], components[1]); } else if (components.length == 3) { result = new ...
LocaleStringBinding extends AbstractStringBinding<Locale> implements Binding<Locale, String> { @Override public Locale unmarshal(String object) { String[] components = object.split("_", 3); final Locale result; if (components.length == 1) { result = new Locale(components[0]); } else if (components.length == 2) { result...
LocaleStringBinding extends AbstractStringBinding<Locale> implements Binding<Locale, String> { @Override public Locale unmarshal(String object) { String[] components = object.split("_", 3); final Locale result; if (components.length == 1) { result = new Locale(components[0]); } else if (components.length == 2) { result...
LocaleStringBinding extends AbstractStringBinding<Locale> implements Binding<Locale, String> { @Override public Locale unmarshal(String object) { String[] components = object.split("_", 3); final Locale result; if (components.length == 1) { result = new Locale(components[0]); } else if (components.length == 2) { result...
LocaleStringBinding extends AbstractStringBinding<Locale> implements Binding<Locale, String> { @Override public Locale unmarshal(String object) { String[] components = object.split("_", 3); final Locale result; if (components.length == 1) { result = new Locale(components[0]); } else if (components.length == 2) { result...
@Test public void testUnmarshal() { assertEquals("Hello World", BINDING.unmarshal("Hello World")); }
@Override public String unmarshal(String object) { return object; }
StringStringBinding extends AbstractStringBinding<String> implements Binding<String, String> { @Override public String unmarshal(String object) { return object; } }
StringStringBinding extends AbstractStringBinding<String> implements Binding<String, String> { @Override public String unmarshal(String object) { return object; } }
StringStringBinding extends AbstractStringBinding<String> implements Binding<String, String> { @Override public String unmarshal(String object) { return object; } @Override String unmarshal(String object); Class<String> getBoundClass(); }
StringStringBinding extends AbstractStringBinding<String> implements Binding<String, String> { @Override public String unmarshal(String object) { return object; } @Override String unmarshal(String object); Class<String> getBoundClass(); }
@Test public void testIntervalBisection() { IntervalBisection bisection = new IntervalBisection(0D, 2D); Double result = bisection.apply(new QuantitativeFunction<Double, Double>() { @Override public Double apply(Double value) { return 2 - Math.pow(Math.E, value); } }); assertEquals(0.693359375D, result, 0.0000000001D);...
public IntervalBisection(double lowerBound, double higherBound) { this(lowerBound, higherBound, 20); }
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { public IntervalBisection(double lowerBound, double higherBound) { this(lowerBound, higherBound, 20); } }
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { public IntervalBisection(double lowerBound, double higherBound) { this(lowerBound, higherBound, 20); } IntervalBisection(double lowerBound, double higherBound); IntervalBisection(double lowerBound, double higherBound, int it...
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { public IntervalBisection(double lowerBound, double higherBound) { this(lowerBound, higherBound, 20); } IntervalBisection(double lowerBound, double higherBound); IntervalBisection(double lowerBound, double higherBound, int it...
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { public IntervalBisection(double lowerBound, double higherBound) { this(lowerBound, higherBound, 20); } IntervalBisection(double lowerBound, double higherBound); IntervalBisection(double lowerBound, double higherBound, int it...
@Test public void testUnmarshal() { assertEquals(Package.getPackage("org.jadira.bindings.core.jdk"), BINDING.unmarshal("org.jadira.bindings.core.jdk")); }
@Override public Package unmarshal(String object) { return Package.getPackage(object); }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public Package unmarshal(String object) { return Package.getPackage(object); } }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public Package unmarshal(String object) { return Package.getPackage(object); } }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public Package unmarshal(String object) { return Package.getPackage(object); } @Override String marshal(Package object); @Override Package unmarshal(String object); Class<Package> getBoundClass(); }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public Package unmarshal(String object) { return Package.getPackage(object); } @Override String marshal(Package object); @Override Package unmarshal(String object); Class<Package> getBoundClass(); }
@Test public void testMarshal() { assertEquals("org.jadira.bindings.core.jdk", BINDING.marshal(Package.getPackage("org.jadira.bindings.core.jdk"))); }
@Override public String marshal(Package object) { return ((Package) object).getName(); }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public String marshal(Package object) { return ((Package) object).getName(); } }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public String marshal(Package object) { return ((Package) object).getName(); } }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public String marshal(Package object) { return ((Package) object).getName(); } @Override String marshal(Package object); @Override Package unmarshal(String object); Class<Package> getBoundClass(); }
PackageStringBinding extends AbstractStringBinding<Package> implements Binding<Package, String> { @Override public String marshal(Package object) { return ((Package) object).getName(); } @Override String marshal(Package object); @Override Package unmarshal(String object); Class<Package> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new Integer(0).toString(), BINDING.unmarshal("0").toString()); assertEquals(new Integer(1).toString(), BINDING.unmarshal("1").toString()); assertEquals(new Integer(2147483647).toString(), BINDING.unmarshal("" + Integer.MAX_VALUE).toString()); assertEquals(new Integer(-21...
@Override public Integer unmarshal(String object) { return Integer.valueOf(Integer.parseInt(object)); }
IntegerStringBinding extends AbstractStringBinding<Integer> implements Binding<Integer, String> { @Override public Integer unmarshal(String object) { return Integer.valueOf(Integer.parseInt(object)); } }
IntegerStringBinding extends AbstractStringBinding<Integer> implements Binding<Integer, String> { @Override public Integer unmarshal(String object) { return Integer.valueOf(Integer.parseInt(object)); } }
IntegerStringBinding extends AbstractStringBinding<Integer> implements Binding<Integer, String> { @Override public Integer unmarshal(String object) { return Integer.valueOf(Integer.parseInt(object)); } @Override Integer unmarshal(String object); Class<Integer> getBoundClass(); }
IntegerStringBinding extends AbstractStringBinding<Integer> implements Binding<Integer, String> { @Override public Integer unmarshal(String object) { return Integer.valueOf(Integer.parseInt(object)); } @Override Integer unmarshal(String object); Class<Integer> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(BigInteger.valueOf(0).toString(), BINDING.unmarshal("0").toString()); assertEquals(BigInteger.valueOf(1).toString(), BINDING.unmarshal("1").toString()); assertEquals(BigInteger.valueOf(9223372036854775807L).toString(), BINDING.unmarshal("" + Long.MAX_VALUE).toString()); ...
@Override public BigInteger unmarshal(String object) { return new BigInteger(object); }
BigIntegerStringBinding extends AbstractStringBinding<BigInteger> implements Binding<BigInteger, String> { @Override public BigInteger unmarshal(String object) { return new BigInteger(object); } }
BigIntegerStringBinding extends AbstractStringBinding<BigInteger> implements Binding<BigInteger, String> { @Override public BigInteger unmarshal(String object) { return new BigInteger(object); } }
BigIntegerStringBinding extends AbstractStringBinding<BigInteger> implements Binding<BigInteger, String> { @Override public BigInteger unmarshal(String object) { return new BigInteger(object); } @Override BigInteger unmarshal(String object); Class<BigInteger> getBoundClass(); }
BigIntegerStringBinding extends AbstractStringBinding<BigInteger> implements Binding<BigInteger, String> { @Override public BigInteger unmarshal(String object) { return new BigInteger(object); } @Override BigInteger unmarshal(String object); Class<BigInteger> getBoundClass(); }
@Test public void testUnmarshal(){ assertEquals(RND, BINDING.unmarshal(RND.toString())); }
@Override public UUID unmarshal(String object) { return java.util.UUID.fromString(object); }
UUIDStringBinding extends AbstractStringBinding<UUID> implements Binding<UUID, String> { @Override public UUID unmarshal(String object) { return java.util.UUID.fromString(object); } }
UUIDStringBinding extends AbstractStringBinding<UUID> implements Binding<UUID, String> { @Override public UUID unmarshal(String object) { return java.util.UUID.fromString(object); } }
UUIDStringBinding extends AbstractStringBinding<UUID> implements Binding<UUID, String> { @Override public UUID unmarshal(String object) { return java.util.UUID.fromString(object); } @Override UUID unmarshal(String object); Class<UUID> getBoundClass(); }
UUIDStringBinding extends AbstractStringBinding<UUID> implements Binding<UUID, String> { @Override public UUID unmarshal(String object) { return java.util.UUID.fromString(object); } @Override UUID unmarshal(String object); Class<UUID> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(TimeZone.getTimeZone("PST"), BINDING.unmarshal("PST")); assertEquals(TimeZone.getTimeZone("GMT+08:00"), BINDING.unmarshal("GMT+08:00")); }
@Override public TimeZone unmarshal(String str) { return TimeZone.getTimeZone(str); }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public TimeZone unmarshal(String str) { return TimeZone.getTimeZone(str); } }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public TimeZone unmarshal(String str) { return TimeZone.getTimeZone(str); } }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public TimeZone unmarshal(String str) { return TimeZone.getTimeZone(str); } @Override String marshal(TimeZone object); @Override TimeZone unmarshal(String str); Class<TimeZone> getBoundClass(); }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public TimeZone unmarshal(String str) { return TimeZone.getTimeZone(str); } @Override String marshal(TimeZone object); @Override TimeZone unmarshal(String str); Class<TimeZone> getBoundClass(); }
@Test public void testMarshal() { assertEquals("PST", BINDING.marshal(TimeZone.getTimeZone("PST"))); assertEquals("GMT+08:00", BINDING.marshal(TimeZone.getTimeZone("GMT+08:00"))); }
@Override public String marshal(TimeZone object) { return object.getID(); }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public String marshal(TimeZone object) { return object.getID(); } }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public String marshal(TimeZone object) { return object.getID(); } }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public String marshal(TimeZone object) { return object.getID(); } @Override String marshal(TimeZone object); @Override TimeZone unmarshal(String str); Class<TimeZone> getBoundClass(); }
TimeZoneStringBinding extends AbstractStringBinding<TimeZone> implements Binding<TimeZone, String> { @Override public String marshal(TimeZone object) { return object.getID(); } @Override String marshal(TimeZone object); @Override TimeZone unmarshal(String str); Class<TimeZone> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new Character('a'), BINDING.unmarshal("a")); assertEquals(new Character('\u00df'), BINDING.unmarshal("\u00df")); }
@Override public Character unmarshal(String object) { if (object.length() == 1) { return Character.valueOf(object.charAt(0)); } else { throw new IllegalArgumentException("Only single character String can be unmarshalled to a Character"); } }
CharacterStringBinding extends AbstractStringBinding<Character> implements Binding<Character, String> { @Override public Character unmarshal(String object) { if (object.length() == 1) { return Character.valueOf(object.charAt(0)); } else { throw new IllegalArgumentException("Only single character String can be unmarshal...
CharacterStringBinding extends AbstractStringBinding<Character> implements Binding<Character, String> { @Override public Character unmarshal(String object) { if (object.length() == 1) { return Character.valueOf(object.charAt(0)); } else { throw new IllegalArgumentException("Only single character String can be unmarshal...
CharacterStringBinding extends AbstractStringBinding<Character> implements Binding<Character, String> { @Override public Character unmarshal(String object) { if (object.length() == 1) { return Character.valueOf(object.charAt(0)); } else { throw new IllegalArgumentException("Only single character String can be unmarshal...
CharacterStringBinding extends AbstractStringBinding<Character> implements Binding<Character, String> { @Override public Character unmarshal(String object) { if (object.length() == 1) { return Character.valueOf(object.charAt(0)); } else { throw new IllegalArgumentException("Only single character String can be unmarshal...
@Test public void testUnmarshal() { assertEquals(new Float(0), BINDING.unmarshal("0")); assertEquals(new Float(1), BINDING.unmarshal("1")); assertEquals(new Float(3.4028235E38F), BINDING.unmarshal("" + Float.MAX_VALUE)); assertEquals(new Float(1.4E-45), BINDING.unmarshal("" + Float.MIN_VALUE)); assertEquals(new Float("...
@Override public Float unmarshal(String object) { return Float.valueOf(Float.parseFloat(object)); }
FloatStringBinding extends AbstractStringBinding<Float> implements Binding<Float, String> { @Override public Float unmarshal(String object) { return Float.valueOf(Float.parseFloat(object)); } }
FloatStringBinding extends AbstractStringBinding<Float> implements Binding<Float, String> { @Override public Float unmarshal(String object) { return Float.valueOf(Float.parseFloat(object)); } }
FloatStringBinding extends AbstractStringBinding<Float> implements Binding<Float, String> { @Override public Float unmarshal(String object) { return Float.valueOf(Float.parseFloat(object)); } @Override Float unmarshal(String object); Class<Float> getBoundClass(); }
FloatStringBinding extends AbstractStringBinding<Float> implements Binding<Float, String> { @Override public Float unmarshal(String object) { return Float.valueOf(Float.parseFloat(object)); } @Override Float unmarshal(String object); Class<Float> getBoundClass(); }
@Test public void testUnmarshal() throws UnknownHostException { assertEquals(InetAddress.getByName("www.google.com"), BINDING.unmarshal("www.google.com")); }
@Override public InetAddress unmarshal(String object) { try { return InetAddress.getByName(object); } catch (UnknownHostException ex) { throw new IllegalArgumentException("Unknown host " + object + ":" + object); } }
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public InetAddress unmarshal(String object) { try { return InetAddress.getByName(object); } catch (UnknownHostException ex) { throw new IllegalArgumentException("Unknown host " + object + ":" + object...
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public InetAddress unmarshal(String object) { try { return InetAddress.getByName(object); } catch (UnknownHostException ex) { throw new IllegalArgumentException("Unknown host " + object + ":" + object...
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public InetAddress unmarshal(String object) { try { return InetAddress.getByName(object); } catch (UnknownHostException ex) { throw new IllegalArgumentException("Unknown host " + object + ":" + object...
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public InetAddress unmarshal(String object) { try { return InetAddress.getByName(object); } catch (UnknownHostException ex) { throw new IllegalArgumentException("Unknown host " + object + ":" + object...
@Test(expected=IntervalBisectionOutOfRangeException.class) public void testOutOfRange() { IntervalBisection bisection = new IntervalBisection(-3D, -1D); Double result = bisection.apply(new QuantitativeFunction<Double, Double>() { @Override public Double apply(Double value) { return 2 - Math.pow(Math.E, value); } }); as...
@Override public Double apply(QuantitativeFunction<Double, Double> computeFunction) { final double resultA = computeFunction.apply(lowerBound); final double resultB = computeFunction.apply(higherBound); if (resultA != 0.0D && resultB != 0.0D && (Double.compare(resultA, 0.0D) ^ Double.compare(0.0D, resultB)) != 0) { thr...
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { @Override public Double apply(QuantitativeFunction<Double, Double> computeFunction) { final double resultA = computeFunction.apply(lowerBound); final double resultB = computeFunction.apply(higherBound); if (resultA != 0.0D &&...
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { @Override public Double apply(QuantitativeFunction<Double, Double> computeFunction) { final double resultA = computeFunction.apply(lowerBound); final double resultB = computeFunction.apply(higherBound); if (resultA != 0.0D &&...
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { @Override public Double apply(QuantitativeFunction<Double, Double> computeFunction) { final double resultA = computeFunction.apply(lowerBound); final double resultB = computeFunction.apply(higherBound); if (resultA != 0.0D &&...
IntervalBisection implements CompositeFunction<Double, QuantitativeFunction<Double, Double>> { @Override public Double apply(QuantitativeFunction<Double, Double> computeFunction) { final double resultA = computeFunction.apply(lowerBound); final double resultB = computeFunction.apply(higherBound); if (resultA != 0.0D &&...
@Test public void testMarshal() throws UnknownHostException { assertEquals("173.194.36.104", BINDING.marshal(InetAddress.getByAddress("173.194.36.104", new byte[]{(byte)173,(byte)194,36,104}))); }
@Override public String marshal(InetAddress object) { return object.getHostAddress(); }
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public String marshal(InetAddress object) { return object.getHostAddress(); } }
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public String marshal(InetAddress object) { return object.getHostAddress(); } }
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public String marshal(InetAddress object) { return object.getHostAddress(); } @Override InetAddress unmarshal(String object); @Override String marshal(InetAddress object); Class<InetAddress> getBound...
InetAddressStringBinding extends AbstractStringBinding<InetAddress> implements Binding<InetAddress, String> { @Override public String marshal(InetAddress object) { return object.getHostAddress(); } @Override InetAddress unmarshal(String object); @Override String marshal(InetAddress object); Class<InetAddress> getBound...
@Test public void testUnmarshal() { assertEquals(Currency.getInstance("USD"), BINDING.unmarshal("USD")); assertEquals(Currency.getInstance("GBP"), BINDING.unmarshal("GBP")); assertEquals(Currency.getInstance("AUD"), BINDING.unmarshal("AUD")); }
@Override public Currency unmarshal(String object) { return Currency.getInstance(object); }
CurrencyStringBinding extends AbstractStringBinding<Currency> implements Binding<Currency, String> { @Override public Currency unmarshal(String object) { return Currency.getInstance(object); } }
CurrencyStringBinding extends AbstractStringBinding<Currency> implements Binding<Currency, String> { @Override public Currency unmarshal(String object) { return Currency.getInstance(object); } }
CurrencyStringBinding extends AbstractStringBinding<Currency> implements Binding<Currency, String> { @Override public Currency unmarshal(String object) { return Currency.getInstance(object); } @Override Currency unmarshal(String object); Class<Currency> getBoundClass(); }
CurrencyStringBinding extends AbstractStringBinding<Currency> implements Binding<Currency, String> { @Override public Currency unmarshal(String object) { return Currency.getInstance(object); } @Override Currency unmarshal(String object); Class<Currency> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new Long(0).toString(), BINDING.unmarshal("0").toString()); assertEquals(new Long(1).toString(), BINDING.unmarshal("1").toString()); assertEquals(new Long(9223372036854775807L).toString(), BINDING.unmarshal("" + Long.MAX_VALUE).toString()); assertEquals(new Long(-9223372...
@Override public Long unmarshal(String object) { return Long.valueOf(Long.parseLong(object)); }
LongStringBinding extends AbstractStringBinding<Long> implements Binding<Long, String> { @Override public Long unmarshal(String object) { return Long.valueOf(Long.parseLong(object)); } }
LongStringBinding extends AbstractStringBinding<Long> implements Binding<Long, String> { @Override public Long unmarshal(String object) { return Long.valueOf(Long.parseLong(object)); } }
LongStringBinding extends AbstractStringBinding<Long> implements Binding<Long, String> { @Override public Long unmarshal(String object) { return Long.valueOf(Long.parseLong(object)); } @Override Long unmarshal(String object); Class<Long> getBoundClass(); }
LongStringBinding extends AbstractStringBinding<Long> implements Binding<Long, String> { @Override public Long unmarshal(String object) { return Long.valueOf(Long.parseLong(object)); } @Override Long unmarshal(String object); Class<Long> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals("Hello World", BINDING.unmarshal("Hello World")); }
@Override public CharSequence unmarshal(String object) { return object; }
CharSequenceStringBinding extends AbstractStringBinding<CharSequence> implements Binding<CharSequence, String> { @Override public CharSequence unmarshal(String object) { return object; } }
CharSequenceStringBinding extends AbstractStringBinding<CharSequence> implements Binding<CharSequence, String> { @Override public CharSequence unmarshal(String object) { return object; } }
CharSequenceStringBinding extends AbstractStringBinding<CharSequence> implements Binding<CharSequence, String> { @Override public CharSequence unmarshal(String object) { return object; } @Override CharSequence unmarshal(String object); Class<CharSequence> getBoundClass(); }
CharSequenceStringBinding extends AbstractStringBinding<CharSequence> implements Binding<CharSequence, String> { @Override public CharSequence unmarshal(String object) { return object; } @Override CharSequence unmarshal(String object); Class<CharSequence> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new AtomicBoolean(true).toString(), BINDING.unmarshal("true").toString()); assertEquals(new AtomicBoolean(false).toString(), BINDING.unmarshal("false").toString()); }
@Override public AtomicBoolean unmarshal(String object) { return new AtomicBoolean(Boolean.parseBoolean(object)); }
AtomicBooleanStringBinding extends AbstractStringBinding<AtomicBoolean> implements Binding<AtomicBoolean, String> { @Override public AtomicBoolean unmarshal(String object) { return new AtomicBoolean(Boolean.parseBoolean(object)); } }
AtomicBooleanStringBinding extends AbstractStringBinding<AtomicBoolean> implements Binding<AtomicBoolean, String> { @Override public AtomicBoolean unmarshal(String object) { return new AtomicBoolean(Boolean.parseBoolean(object)); } }
AtomicBooleanStringBinding extends AbstractStringBinding<AtomicBoolean> implements Binding<AtomicBoolean, String> { @Override public AtomicBoolean unmarshal(String object) { return new AtomicBoolean(Boolean.parseBoolean(object)); } @Override AtomicBoolean unmarshal(String object); Class<AtomicBoolean> getBoundClass();...
AtomicBooleanStringBinding extends AbstractStringBinding<AtomicBoolean> implements Binding<AtomicBoolean, String> { @Override public AtomicBoolean unmarshal(String object) { return new AtomicBoolean(Boolean.parseBoolean(object)); } @Override AtomicBoolean unmarshal(String object); Class<AtomicBoolean> getBoundClass();...
@Test public void testSayHello() { assertEquals("Hello World!", basicBinder.convertTo(HelloWorld.class, String.class, helloWorld)); }
public <S, T> T convertTo(Class<T> output, Object object) { return BINDING.convertTo(output, object); }
BinderExtension implements Extension, Binder, RegisterableBinder { public <S, T> T convertTo(Class<T> output, Object object) { return BINDING.convertTo(output, object); } }
BinderExtension implements Extension, Binder, RegisterableBinder { public <S, T> T convertTo(Class<T> output, Object object) { return BINDING.convertTo(output, object); } BinderExtension(); }
BinderExtension implements Extension, Binder, RegisterableBinder { public <S, T> T convertTo(Class<T> output, Object object) { return BINDING.convertTo(output, object); } BinderExtension(); void processAnnotatedType(@Observes ProcessAnnotatedType<T> pat); T convertTo(Class<T> output, Object object); T convertTo(Class<T...
BinderExtension implements Extension, Binder, RegisterableBinder { public <S, T> T convertTo(Class<T> output, Object object) { return BINDING.convertTo(output, object); } BinderExtension(); void processAnnotatedType(@Observes ProcessAnnotatedType<T> pat); T convertTo(Class<T> output, Object object); T convertTo(Class<T...
@Test public void testGetClass() { String className = "java.net.URL"; assertEquals(URL.class, ClassUtils.getClass(getClass().getClassLoader(), className)); assertEquals(URL.class, ClassUtils.getClass(getClass().getClassLoader(), className + " ")); assertEquals(new URL[]{}.getClass(), ClassUtils.getClass(getClass().getC...
public static Class<?> getClass(String qualifiedName) { return getClass(ClassLoaderUtils.getClassLoader(), qualifiedName); }
ClassUtils { public static Class<?> getClass(String qualifiedName) { return getClass(ClassLoaderUtils.getClassLoader(), qualifiedName); } }
ClassUtils { public static Class<?> getClass(String qualifiedName) { return getClass(ClassLoaderUtils.getClassLoader(), qualifiedName); } private ClassUtils(); }
ClassUtils { public static Class<?> getClass(String qualifiedName) { return getClass(ClassLoaderUtils.getClassLoader(), qualifiedName); } private ClassUtils(); static Class<?> getClass(String qualifiedName); static Class<?> getClass(ClassLoader classLoader, String className); static String determineQualifiedName(Strin...
ClassUtils { public static Class<?> getClass(String qualifiedName) { return getClass(ClassLoaderUtils.getClassLoader(), qualifiedName); } private ClassUtils(); static Class<?> getClass(String qualifiedName); static Class<?> getClass(ClassLoader classLoader, String className); static String determineQualifiedName(Strin...
@Test public void testDetermineQualifiedName() { String className = "org.jadira.bindings.core.utils.string.ClassUtilsTest"; assertEquals("org.jadira.bindings.core.utils.string.ClassUtilsTest", ClassUtils.determineQualifiedName(className)); assertEquals("org.jadira.bindings.core.utils.string.ClassUtilsTest", ClassUtils....
public static String determineQualifiedName(String className) { String readableClassName = StringUtils.removeWhitespace(className); if (readableClassName == null) { throw new IllegalArgumentException("readableClassName must not be null."); } else if (readableClassName.endsWith("[]")) { StringBuilder classNameBuffer = n...
ClassUtils { public static String determineQualifiedName(String className) { String readableClassName = StringUtils.removeWhitespace(className); if (readableClassName == null) { throw new IllegalArgumentException("readableClassName must not be null."); } else if (readableClassName.endsWith("[]")) { StringBuilder classN...
ClassUtils { public static String determineQualifiedName(String className) { String readableClassName = StringUtils.removeWhitespace(className); if (readableClassName == null) { throw new IllegalArgumentException("readableClassName must not be null."); } else if (readableClassName.endsWith("[]")) { StringBuilder classN...
ClassUtils { public static String determineQualifiedName(String className) { String readableClassName = StringUtils.removeWhitespace(className); if (readableClassName == null) { throw new IllegalArgumentException("readableClassName must not be null."); } else if (readableClassName.endsWith("[]")) { StringBuilder classN...
ClassUtils { public static String determineQualifiedName(String className) { String readableClassName = StringUtils.removeWhitespace(className); if (readableClassName == null) { throw new IllegalArgumentException("readableClassName must not be null."); } else if (readableClassName.endsWith("[]")) { StringBuilder classN...
@Test public void testDetermineReadableClassName() { String className = "org.jadira.bindings.core.utils.string.ClassUtilsTest"; assertEquals("org.jadira.bindings.core.utils.string.ClassUtilsTest", ClassUtils.determineReadableClassName(className)); assertEquals("org.jadira.bindings.core.utils.string.ClassUtilsTest", Cla...
public static String determineReadableClassName(String qualifiedName) { String readableClassName = StringUtils.removeWhitespace(qualifiedName); if (readableClassName == null) { throw new IllegalArgumentException("qualifiedName must not be null."); } else if (readableClassName.startsWith("[")) { StringBuilder classNameB...
ClassUtils { public static String determineReadableClassName(String qualifiedName) { String readableClassName = StringUtils.removeWhitespace(qualifiedName); if (readableClassName == null) { throw new IllegalArgumentException("qualifiedName must not be null."); } else if (readableClassName.startsWith("[")) { StringBuild...
ClassUtils { public static String determineReadableClassName(String qualifiedName) { String readableClassName = StringUtils.removeWhitespace(qualifiedName); if (readableClassName == null) { throw new IllegalArgumentException("qualifiedName must not be null."); } else if (readableClassName.startsWith("[")) { StringBuild...
ClassUtils { public static String determineReadableClassName(String qualifiedName) { String readableClassName = StringUtils.removeWhitespace(qualifiedName); if (readableClassName == null) { throw new IllegalArgumentException("qualifiedName must not be null."); } else if (readableClassName.startsWith("[")) { StringBuild...
ClassUtils { public static String determineReadableClassName(String qualifiedName) { String readableClassName = StringUtils.removeWhitespace(qualifiedName); if (readableClassName == null) { throw new IllegalArgumentException("qualifiedName must not be null."); } else if (readableClassName.startsWith("[")) { StringBuild...
@Test public void testGetClassLoader() { assertEquals("sun.misc.Launcher$AppClassLoader", ClassLoaderUtils.getClassLoader().getClass().getName()); }
public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassStringBinding.class.getClassLoader(); } return cl; }
ClassLoaderUtils { public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassStringBinding.class.getClassLoader(); } return cl; } }
ClassLoaderUtils { public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassStringBinding.class.getClassLoader(); } return cl; } private ClassLoaderUtils(); }
ClassLoaderUtils { public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassStringBinding.class.getClassLoader(); } return cl; } private ClassLoaderUtils(); static ClassLoader getClassLoader(); }
ClassLoaderUtils { public static ClassLoader getClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) { cl = ClassStringBinding.class.getClassLoader(); } return cl; } private ClassLoaderUtils(); static ClassLoader getClassLoader(); }
@Test public void testUnmarshal() { assertEquals(new AtomicLong(0).toString(), BINDING.unmarshal("0").toString()); assertEquals(new AtomicLong(1).toString(), BINDING.unmarshal("1").toString()); assertEquals(new AtomicLong(9223372036854775807L).toString(), BINDING.unmarshal("" + Long.MAX_VALUE).toString()); assertEquals...
@Override public AtomicLong unmarshal(String object) { return new AtomicLong(Long.parseLong(object)); }
AtomicLongStringBinding extends AbstractStringBinding<AtomicLong> implements Binding<AtomicLong, String> { @Override public AtomicLong unmarshal(String object) { return new AtomicLong(Long.parseLong(object)); } }
AtomicLongStringBinding extends AbstractStringBinding<AtomicLong> implements Binding<AtomicLong, String> { @Override public AtomicLong unmarshal(String object) { return new AtomicLong(Long.parseLong(object)); } }
AtomicLongStringBinding extends AbstractStringBinding<AtomicLong> implements Binding<AtomicLong, String> { @Override public AtomicLong unmarshal(String object) { return new AtomicLong(Long.parseLong(object)); } @Override AtomicLong unmarshal(String object); Class<AtomicLong> getBoundClass(); }
AtomicLongStringBinding extends AbstractStringBinding<AtomicLong> implements Binding<AtomicLong, String> { @Override public AtomicLong unmarshal(String object) { return new AtomicLong(Long.parseLong(object)); } @Override AtomicLong unmarshal(String object); Class<AtomicLong> getBoundClass(); }
@Test public void testIterableEnumeration() { Iterable<String> testIterable = new IterableEnumeration<String>(ELEMENTS.elements()); Iterator<String> myIter = testIterable.iterator(); testValues(myIter); testIterable = IterableEnumeration.wrapEnumeration(ELEMENTS.elements()); myIter = testIterable.iterator(); testValues...
public IterableEnumeration(Enumeration<E> enumeration) { this.enumeration = enumeration; }
IterableEnumeration implements Iterable<E> { public IterableEnumeration(Enumeration<E> enumeration) { this.enumeration = enumeration; } }
IterableEnumeration implements Iterable<E> { public IterableEnumeration(Enumeration<E> enumeration) { this.enumeration = enumeration; } IterableEnumeration(Enumeration<E> enumeration); }
IterableEnumeration implements Iterable<E> { public IterableEnumeration(Enumeration<E> enumeration) { this.enumeration = enumeration; } IterableEnumeration(Enumeration<E> enumeration); Iterator<E> iterator(); static Iterable<E> wrapEnumeration(Enumeration<E> enumeration); }
IterableEnumeration implements Iterable<E> { public IterableEnumeration(Enumeration<E> enumeration) { this.enumeration = enumeration; } IterableEnumeration(Enumeration<E> enumeration); Iterator<E> iterator(); static Iterable<E> wrapEnumeration(Enumeration<E> enumeration); }
@Test public void testRemoveWhitespace() { assertEquals("Helloworld", StringUtils.removeWhitespace("Hello world")); assertEquals("Hello\uD840\uDC08", StringUtils.removeWhitespace("Hello \uD840\uDC08")); assertEquals("Hello\uD840\uDC08", StringUtils.removeWhitespace(" Hello \uD840\uDC08 ")); assertEquals("Hello\uD840\uD...
public static String removeWhitespace(String string) { if (string == null || string.length() == 0) { return string; } else { int codePoints = string.codePointCount(0, string.length()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < codePoints; i++) { int offset = string.offsetByCodePoints(0, i); int nextCo...
StringUtils { public static String removeWhitespace(String string) { if (string == null || string.length() == 0) { return string; } else { int codePoints = string.codePointCount(0, string.length()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < codePoints; i++) { int offset = string.offsetByCodePoints(0, ...
StringUtils { public static String removeWhitespace(String string) { if (string == null || string.length() == 0) { return string; } else { int codePoints = string.codePointCount(0, string.length()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < codePoints; i++) { int offset = string.offsetByCodePoints(0, ...
StringUtils { public static String removeWhitespace(String string) { if (string == null || string.length() == 0) { return string; } else { int codePoints = string.codePointCount(0, string.length()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < codePoints; i++) { int offset = string.offsetByCodePoints(0, ...
StringUtils { public static String removeWhitespace(String string) { if (string == null || string.length() == 0) { return string; } else { int codePoints = string.codePointCount(0, string.length()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < codePoints; i++) { int offset = string.offsetByCodePoints(0, ...
@Test public void testBindingConverter() { assertEquals(new SubjectC("String"), svc.convert("String:String", SubjectC.class)); }
public Object convert(Object object, TypeDescriptor sourceType, TypeDescriptor targetType) { final Object result; result = BINDING.convertTo(object.getClass(), targetType.getObjectType(), object, matchAnnotationToScope(targetType.getAnnotations())); return result; }
BindingConverter implements ConditionalGenericConverter { public Object convert(Object object, TypeDescriptor sourceType, TypeDescriptor targetType) { final Object result; result = BINDING.convertTo(object.getClass(), targetType.getObjectType(), object, matchAnnotationToScope(targetType.getAnnotations())); return resul...
BindingConverter implements ConditionalGenericConverter { public Object convert(Object object, TypeDescriptor sourceType, TypeDescriptor targetType) { final Object result; result = BINDING.convertTo(object.getClass(), targetType.getObjectType(), object, matchAnnotationToScope(targetType.getAnnotations())); return resul...
BindingConverter implements ConditionalGenericConverter { public Object convert(Object object, TypeDescriptor sourceType, TypeDescriptor targetType) { final Object result; result = BINDING.convertTo(object.getClass(), targetType.getObjectType(), object, matchAnnotationToScope(targetType.getAnnotations())); return resul...
BindingConverter implements ConditionalGenericConverter { public Object convert(Object object, TypeDescriptor sourceType, TypeDescriptor targetType) { final Object result; result = BINDING.convertTo(object.getClass(), targetType.getObjectType(), object, matchAnnotationToScope(targetType.getAnnotations())); return resul...
@Test public void testGetCountryDiallingCode() { E164PhoneNumberWithExtension number = E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension("1963350474", null, ISOCountryCode.GB); assertEquals("+44", number.getCountryDiallingCode()); }
public String getCountryDiallingCode() { return "+" + number.getCountryCode(); }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getCountryDiallingCode() { return "+" + number.getCountryCode(); } }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getCountryDiallingCode() { return "+" + number.getCountryCode(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWi...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getCountryDiallingCode() { return "+" + number.getCountryCode(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWi...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getCountryDiallingCode() { return "+" + number.getCountryCode(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWi...
@Test public void testGetNationalNumber() { E164PhoneNumberWithExtension number = E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension("+441963350474", null, ISOCountryCode.DE); assertEquals("1963350474", number.getNationalNumber()); }
public String getNationalNumber() { return "" + number.getNationalNumber(); }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getNationalNumber() { return "" + number.getNationalNumber(); } }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getNationalNumber() { return "" + number.getNationalNumber(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWithE...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getNationalNumber() { return "" + number.getNationalNumber(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWithE...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getNationalNumber() { return "" + number.getNationalNumber(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWithE...
@Test public void testGetExtension() { E164PhoneNumberWithExtension number = E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension("+441963350474", null, ISOCountryCode.DE); assertNull(number.getExtension()); number = E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension("+441963350474", "14354", ISOCount...
public String getExtension() { return number.hasExtension() ? number.getExtension() : null; }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getExtension() { return number.hasExtension() ? number.getExtension() : null; } }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getExtension() { return number.hasExtension() ? number.getExtension() : null; } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getExtension() { return number.hasExtension() ? number.getExtension() : null; } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String getExtension() { return number.hasExtension() ? number.getExtension() : null; } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164...
@Test public void testToE164NumberString() { E164PhoneNumberWithExtension number = E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension("1963350474", null, ISOCountryCode.GB); assertEquals("+441963350474", number.toE164NumberString()); }
public String toE164NumberString() { StringBuilder result = new StringBuilder(); PHONE_NUMBER_UTIL.format(number, PhoneNumberFormat.E164, result); return result.toString(); }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String toE164NumberString() { StringBuilder result = new StringBuilder(); PHONE_NUMBER_UTIL.format(number, PhoneNumberFormat.E164, result); return result.toString(); } }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String toE164NumberString() { StringBuilder result = new StringBuilder(); PHONE_NUMBER_UTIL.format(number, PhoneNumberFormat.E164, result); return result.toString(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String toE164NumberString() { StringBuilder result = new StringBuilder(); PHONE_NUMBER_UTIL.format(number, PhoneNumberFormat.E164, result); return result.toString(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { public String toE164NumberString() { StringBuilder result = new StringBuilder(); PHONE_NUMBER_UTIL.format(number, PhoneNumberFormat.E164, result); return result.toString(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E...
@Test public void testToString() { E164PhoneNumberWithExtension number = E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension("+441963350474", null, ISOCountryCode.DE); assertEquals("+441963350474", number.toString()); number = E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension("+441963350474", "14354...
@Override public String toString() { return toE164NumberWithExtensionString(); }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { @Override public String toString() { return toE164NumberWithExtensionString(); } }
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { @Override public String toString() { return toE164NumberWithExtensionString(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWi...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { @Override public String toString() { return toE164NumberWithExtensionString(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWi...
E164PhoneNumberWithExtension implements PhoneNumber, Serializable { @Override public String toString() { return toE164NumberWithExtensionString(); } E164PhoneNumberWithExtension(Phonenumber.PhoneNumber prototype); protected E164PhoneNumberWithExtension(String e164PhoneNumberWithExtension); protected E164PhoneNumberWi...
@Test public void simpleExecution() throws ClasspathAccessException, FileNotFoundException { ClasspathResolver helper = new ClasspathResolver(new JavaClasspathUrlLocator().locate()); JPackage pkg = JPackage.getJPackage("org.jadira.scanner.classpath", helper); Set<JClass> classes = pkg.getClasses(); List<JClass> sortedC...
@Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
@Test public void simpleExecution2() throws ClasspathAccessException, FileNotFoundException { ClasspathResolver helper = new ClasspathResolver(new JavaClasspathUrlLocator().locate()); JPackage pkg = JPackage.getJPackage("org.jadira.scanner.classpath", helper); Set<JClass> classes = pkg.getClasses(); List<JClass> sorted...
@Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
@Test public void testUnmarshal() { String className = "java.net.URL"; assertEquals(URL.class, BINDING.unmarshal(className)); assertEquals(new URL[]{}.getClass(), BINDING.unmarshal(className + "[]")); assertEquals(new URL[][]{}.getClass(), BINDING.unmarshal(className + "[][]")); assertEquals(Long.TYPE, BINDING.unmarsha...
@Override public Class unmarshal(String object) { return ClassUtils.getClass(object); }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public Class unmarshal(String object) { return ClassUtils.getClass(object); } }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public Class unmarshal(String object) { return ClassUtils.getClass(object); } }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public Class unmarshal(String object) { return ClassUtils.getClass(object); } @Override Class unmarshal(String object); @Override String marshal(Class clazz); Class<Class> getBoundClass(); }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public Class unmarshal(String object) { return ClassUtils.getClass(object); } @Override Class unmarshal(String object); @Override String marshal(Class clazz); Class<Class> getBoundClass(); }
@Test public void simpleVisit() throws ClasspathAccessException, FileNotFoundException { ClasspathResolver helper = new ClasspathResolver(); JPackage pkg = JPackage.getJPackage("java", helper); Set<JClass> classes = pkg.getClasses(); for (JClass next : classes) { next.acceptVisitor(new IntrospectionVisitor() { @Overrid...
@Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
@Test public void simpleVisit2() throws ClasspathAccessException, FileNotFoundException { ClasspathResolver helper = new ClasspathResolver(); JPackage pkg = JPackage.getJPackage("java.util", helper); Set<JClass> classes = pkg.getClasses(); for (JClass next : classes) { next.acceptVisitor(new IntrospectionVisitor() { @O...
@Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } }
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
ClasspathResolver extends AbstractFileResolver<JElement> { @Override public String toString() { ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); builder.append(getDriverData().toArray()); return builder.toString(); } ClasspathResolver(); ClasspathResolver(List<URL> classpaths); C...
@Test public void getSuperInterfaces() throws ClasspathAccessException { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.awt.event.AWTEventListener", helper); List<JInterface> superIntf = intf.getSuperInterfaces(); assertEquals(1, superIntf.size()); assertEquals(java...
public List<JInterface> getSuperInterfaces() throws ClasspathAccessException { final List<JInterface> retVal = new ArrayList<JInterface>(); String[] interfaces = getClassFile().getInterfaces(); for (String next : interfaces) { retVal.add(JInterface.getJInterface(next, getResolver())); } return retVal; }
JInterface extends JType { public List<JInterface> getSuperInterfaces() throws ClasspathAccessException { final List<JInterface> retVal = new ArrayList<JInterface>(); String[] interfaces = getClassFile().getInterfaces(); for (String next : interfaces) { retVal.add(JInterface.getJInterface(next, getResolver())); } retur...
JInterface extends JType { public List<JInterface> getSuperInterfaces() throws ClasspathAccessException { final List<JInterface> retVal = new ArrayList<JInterface>(); String[] interfaces = getClassFile().getInterfaces(); for (String next : interfaces) { retVal.add(JInterface.getJInterface(next, getResolver())); } retur...
JInterface extends JType { public List<JInterface> getSuperInterfaces() throws ClasspathAccessException { final List<JInterface> retVal = new ArrayList<JInterface>(); String[] interfaces = getClassFile().getInterfaces(); for (String next : interfaces) { retVal.add(JInterface.getJInterface(next, getResolver())); } retur...
JInterface extends JType { public List<JInterface> getSuperInterfaces() throws ClasspathAccessException { final List<JInterface> retVal = new ArrayList<JInterface>(); String[] interfaces = getClassFile().getInterfaces(); for (String next : interfaces) { retVal.add(JInterface.getJInterface(next, getResolver())); } retur...
@Test public void getMethods() { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.awt.event.AWTEventListener", helper); List<JInterface> superIntf = intf.getSuperInterfaces(); assertEquals(1, superIntf.size()); assertEquals(0, superIntf.get(0).getMethods().size()); as...
public List<JMethod> getMethods() { final List<JMethod> retVal = new ArrayList<JMethod>(); @SuppressWarnings("unchecked") final List<MethodInfo> methods = (List<MethodInfo>) getClassFile().getMethods(); for (MethodInfo next : methods) { if (next.isMethod()) { retVal.add(JMethod.getJMethod(next, this, getResolver())); }...
JInterface extends JType { public List<JMethod> getMethods() { final List<JMethod> retVal = new ArrayList<JMethod>(); @SuppressWarnings("unchecked") final List<MethodInfo> methods = (List<MethodInfo>) getClassFile().getMethods(); for (MethodInfo next : methods) { if (next.isMethod()) { retVal.add(JMethod.getJMethod(nex...
JInterface extends JType { public List<JMethod> getMethods() { final List<JMethod> retVal = new ArrayList<JMethod>(); @SuppressWarnings("unchecked") final List<MethodInfo> methods = (List<MethodInfo>) getClassFile().getMethods(); for (MethodInfo next : methods) { if (next.isMethod()) { retVal.add(JMethod.getJMethod(nex...
JInterface extends JType { public List<JMethod> getMethods() { final List<JMethod> retVal = new ArrayList<JMethod>(); @SuppressWarnings("unchecked") final List<MethodInfo> methods = (List<MethodInfo>) getClassFile().getMethods(); for (MethodInfo next : methods) { if (next.isMethod()) { retVal.add(JMethod.getJMethod(nex...
JInterface extends JType { public List<JMethod> getMethods() { final List<JMethod> retVal = new ArrayList<JMethod>(); @SuppressWarnings("unchecked") final List<MethodInfo> methods = (List<MethodInfo>) getClassFile().getMethods(); for (MethodInfo next : methods) { if (next.isMethod()) { retVal.add(JMethod.getJMethod(nex...
@Test public void getActualInterface() { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.awt.event.AWTEventListener", helper); assertEquals(java.awt.event.AWTEventListener.class, intf.getActualClass()); assertEquals(java.awt.event.AWTEventListener.class, intf.getActu...
public Class<?> getActualInterface() throws ClasspathAccessException { return getResolver().loadClass(getClassFile().getName()); }
JInterface extends JType { public Class<?> getActualInterface() throws ClasspathAccessException { return getResolver().loadClass(getClassFile().getName()); } }
JInterface extends JType { public Class<?> getActualInterface() throws ClasspathAccessException { return getResolver().loadClass(getClassFile().getName()); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); }
JInterface extends JType { public Class<?> getActualInterface() throws ClasspathAccessException { return getResolver().loadClass(getClassFile().getName()); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); static JInterface getJInte...
JInterface extends JType { public Class<?> getActualInterface() throws ClasspathAccessException { return getResolver().loadClass(getClassFile().getName()); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); static JInterface getJInte...
@SuppressWarnings("deprecation") @Test public void getAnnotations() { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.rmi.registry.RegistryHandler", helper); assertEquals(java.rmi.registry.RegistryHandler.class, intf.getActualClass()); assertEquals(java.rmi.registry....
@Override public Set<JAnnotation<?>> getAnnotations() throws ClasspathAccessException { AnnotationsAttribute visible = (AnnotationsAttribute) getClassFile().getAttribute(AnnotationsAttribute.visibleTag); AnnotationsAttribute invisible = (AnnotationsAttribute) getClassFile().getAttribute(AnnotationsAttribute.invisibleTa...
JInterface extends JType { @Override public Set<JAnnotation<?>> getAnnotations() throws ClasspathAccessException { AnnotationsAttribute visible = (AnnotationsAttribute) getClassFile().getAttribute(AnnotationsAttribute.visibleTag); AnnotationsAttribute invisible = (AnnotationsAttribute) getClassFile().getAttribute(Annot...
JInterface extends JType { @Override public Set<JAnnotation<?>> getAnnotations() throws ClasspathAccessException { AnnotationsAttribute visible = (AnnotationsAttribute) getClassFile().getAttribute(AnnotationsAttribute.visibleTag); AnnotationsAttribute invisible = (AnnotationsAttribute) getClassFile().getAttribute(Annot...
JInterface extends JType { @Override public Set<JAnnotation<?>> getAnnotations() throws ClasspathAccessException { AnnotationsAttribute visible = (AnnotationsAttribute) getClassFile().getAttribute(AnnotationsAttribute.visibleTag); AnnotationsAttribute invisible = (AnnotationsAttribute) getClassFile().getAttribute(Annot...
JInterface extends JType { @Override public Set<JAnnotation<?>> getAnnotations() throws ClasspathAccessException { AnnotationsAttribute visible = (AnnotationsAttribute) getClassFile().getAttribute(AnnotationsAttribute.visibleTag); AnnotationsAttribute invisible = (AnnotationsAttribute) getClassFile().getAttribute(Annot...
@Test public void getPackage() { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.awt.event.AWTEventListener", helper); assertEquals("java.awt.event", intf.getPackage().getName()); assertEquals(Package.getPackage("java.awt.event"), intf.getPackage().getActualPackage()...
@Override public JPackage getPackage() throws ClasspathAccessException { String fqClassName = getClassFile().getName(); String packageName; if (fqClassName.contains(".")) { packageName = fqClassName.substring(0, fqClassName.lastIndexOf('.')); } else { packageName = ""; } return JPackage.getJPackage(packageName, getReso...
JInterface extends JType { @Override public JPackage getPackage() throws ClasspathAccessException { String fqClassName = getClassFile().getName(); String packageName; if (fqClassName.contains(".")) { packageName = fqClassName.substring(0, fqClassName.lastIndexOf('.')); } else { packageName = ""; } return JPackage.getJP...
JInterface extends JType { @Override public JPackage getPackage() throws ClasspathAccessException { String fqClassName = getClassFile().getName(); String packageName; if (fqClassName.contains(".")) { packageName = fqClassName.substring(0, fqClassName.lastIndexOf('.')); } else { packageName = ""; } return JPackage.getJP...
JInterface extends JType { @Override public JPackage getPackage() throws ClasspathAccessException { String fqClassName = getClassFile().getName(); String packageName; if (fqClassName.contains(".")) { packageName = fqClassName.substring(0, fqClassName.lastIndexOf('.')); } else { packageName = ""; } return JPackage.getJP...
JInterface extends JType { @Override public JPackage getPackage() throws ClasspathAccessException { String fqClassName = getClassFile().getName(); String packageName; if (fqClassName.contains(".")) { packageName = fqClassName.substring(0, fqClassName.lastIndexOf('.')); } else { packageName = ""; } return JPackage.getJP...
@Test public void getActualClass() { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.awt.event.AWTEventListener", helper); assertEquals(java.awt.event.AWTEventListener.class, intf.getActualClass()); }
@Override public Class<?> getActualClass() throws ClasspathAccessException { return getActualInterface(); }
JInterface extends JType { @Override public Class<?> getActualClass() throws ClasspathAccessException { return getActualInterface(); } }
JInterface extends JType { @Override public Class<?> getActualClass() throws ClasspathAccessException { return getActualInterface(); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); }
JInterface extends JType { @Override public Class<?> getActualClass() throws ClasspathAccessException { return getActualInterface(); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); static JInterface getJInterface(String name, Clas...
JInterface extends JType { @Override public Class<?> getActualClass() throws ClasspathAccessException { return getActualInterface(); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); static JInterface getJInterface(String name, Clas...
@Test public void acceptVisitor() { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.awt.event.AWTEventListener", helper); CollectingVisitor visitor = new CollectingVisitor(); intf.acceptVisitor(visitor); assertEquals(4, visitor.getVisitedElements().size()); }
@Override public void acceptVisitor(IntrospectionVisitor visitor) throws ClasspathAccessException { visitor.visit(this); for (JInterface next : getSuperInterfaces()) { next.acceptVisitor(visitor); } for (JMethod next : getMethods()) { next.acceptVisitor(visitor); } for (JAnnotation<?> next : getAnnotations()) { next.ac...
JInterface extends JType { @Override public void acceptVisitor(IntrospectionVisitor visitor) throws ClasspathAccessException { visitor.visit(this); for (JInterface next : getSuperInterfaces()) { next.acceptVisitor(visitor); } for (JMethod next : getMethods()) { next.acceptVisitor(visitor); } for (JAnnotation<?> next : ...
JInterface extends JType { @Override public void acceptVisitor(IntrospectionVisitor visitor) throws ClasspathAccessException { visitor.visit(this); for (JInterface next : getSuperInterfaces()) { next.acceptVisitor(visitor); } for (JMethod next : getMethods()) { next.acceptVisitor(visitor); } for (JAnnotation<?> next : ...
JInterface extends JType { @Override public void acceptVisitor(IntrospectionVisitor visitor) throws ClasspathAccessException { visitor.visit(this); for (JInterface next : getSuperInterfaces()) { next.acceptVisitor(visitor); } for (JMethod next : getMethods()) { next.acceptVisitor(visitor); } for (JAnnotation<?> next : ...
JInterface extends JType { @Override public void acceptVisitor(IntrospectionVisitor visitor) throws ClasspathAccessException { visitor.visit(this); for (JInterface next : getSuperInterfaces()) { next.acceptVisitor(visitor); } for (JMethod next : getMethods()) { next.acceptVisitor(visitor); } for (JAnnotation<?> next : ...
@Test public void getEnclosingElement() { ClasspathResolver helper = new ClasspathResolver(); JInterface intf = JInterface.getJInterface("java.awt.event.AWTEventListener", helper); assertEquals("java.awt.event", intf.getPackage().getName()); assertEquals("java.awt.event", intf.getEnclosingElement().getName()); }
@Override public JPackage getEnclosingElement() { return getPackage(); }
JInterface extends JType { @Override public JPackage getEnclosingElement() { return getPackage(); } }
JInterface extends JType { @Override public JPackage getEnclosingElement() { return getPackage(); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); }
JInterface extends JType { @Override public JPackage getEnclosingElement() { return getPackage(); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); static JInterface getJInterface(String name, ClasspathResolver resolver); static JIn...
JInterface extends JType { @Override public JPackage getEnclosingElement() { return getPackage(); } protected JInterface(String name, ClasspathResolver resolver); protected JInterface(ClassFile classFile, ClasspathResolver resolver); static JInterface getJInterface(String name, ClasspathResolver resolver); static JIn...
@Test public void testMarshal() { assertEquals("org.jadira.bindings.core.jdk.ClassStringBindingTest", BINDING.marshal(ClassStringBindingTest.class)); assertEquals("org.jadira.bindings.core.jdk.ClassStringBindingTest[]", BINDING.marshal(new ClassStringBindingTest[]{}.getClass())); assertEquals("org.jadira.bindings.core....
@Override public String marshal(Class clazz) { return ClassUtils.determineReadableClassName(clazz.getName()); }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public String marshal(Class clazz) { return ClassUtils.determineReadableClassName(clazz.getName()); } }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public String marshal(Class clazz) { return ClassUtils.determineReadableClassName(clazz.getName()); } }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public String marshal(Class clazz) { return ClassUtils.determineReadableClassName(clazz.getName()); } @Override Class unmarshal(String object); @Override String marshal(Class clazz); Class<Class> getBoundClass(); }
ClassStringBinding extends AbstractStringBinding<Class> implements Binding<Class, String> { @Override public String marshal(Class clazz) { return ClassUtils.determineReadableClassName(clazz.getName()); } @Override Class unmarshal(String object); @Override String marshal(Class clazz); Class<Class> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new Short((short)0).toString(), BINDING.unmarshal("0").toString()); assertEquals(new Short((short)1).toString(), BINDING.unmarshal("1").toString()); assertEquals(new Short((short)32767).toString(), BINDING.unmarshal("" + Short.MAX_VALUE).toString()); assertEquals(new Sho...
@Override public Short unmarshal(String object) { return Short.valueOf(Short.parseShort(object)); }
ShortStringBinding extends AbstractStringBinding<Short> implements Binding<Short, String> { @Override public Short unmarshal(String object) { return Short.valueOf(Short.parseShort(object)); } }
ShortStringBinding extends AbstractStringBinding<Short> implements Binding<Short, String> { @Override public Short unmarshal(String object) { return Short.valueOf(Short.parseShort(object)); } }
ShortStringBinding extends AbstractStringBinding<Short> implements Binding<Short, String> { @Override public Short unmarshal(String object) { return Short.valueOf(Short.parseShort(object)); } @Override Short unmarshal(String object); Class<Short> getBoundClass(); }
ShortStringBinding extends AbstractStringBinding<Short> implements Binding<Short, String> { @Override public Short unmarshal(String object) { return Short.valueOf(Short.parseShort(object)); } @Override Short unmarshal(String object); Class<Short> getBoundClass(); }
@Test public void testUnmarshal() { assertEquals(new AtomicInteger(0).toString(), BINDING.unmarshal("0").toString()); assertEquals(new AtomicInteger(1).toString(), BINDING.unmarshal("1").toString()); assertEquals(new AtomicInteger(2147483647).toString(), BINDING.unmarshal("" + Integer.MAX_VALUE).toString()); assertEqua...
@Override public AtomicInteger unmarshal(String object) { return new AtomicInteger(Integer.parseInt(object)); }
AtomicIntegerStringBinding extends AbstractStringBinding<AtomicInteger> implements Binding<AtomicInteger, String> { @Override public AtomicInteger unmarshal(String object) { return new AtomicInteger(Integer.parseInt(object)); } }
AtomicIntegerStringBinding extends AbstractStringBinding<AtomicInteger> implements Binding<AtomicInteger, String> { @Override public AtomicInteger unmarshal(String object) { return new AtomicInteger(Integer.parseInt(object)); } }
AtomicIntegerStringBinding extends AbstractStringBinding<AtomicInteger> implements Binding<AtomicInteger, String> { @Override public AtomicInteger unmarshal(String object) { return new AtomicInteger(Integer.parseInt(object)); } @Override AtomicInteger unmarshal(String object); Class<AtomicInteger> getBoundClass(); }
AtomicIntegerStringBinding extends AbstractStringBinding<AtomicInteger> implements Binding<AtomicInteger, String> { @Override public AtomicInteger unmarshal(String object) { return new AtomicInteger(Integer.parseInt(object)); } @Override AtomicInteger unmarshal(String object); Class<AtomicInteger> getBoundClass(); }
@Test public void testUnmarshal() { Calendar cal = new GregorianCalendar(); cal.setTimeZone(TimeZone.getTimeZone("Europe/London")); cal.setTimeInMillis(0); cal.set(2000, 10, 1, 23, 45); assertEquals(cal, BINDING.unmarshal("2000-11-01T23:45:00.000+00:00[Europe/London]")); }
@Override public Calendar unmarshal(String object) { if (object.length() < 31 || object.charAt(26) != ':' || object.charAt(29) != '[' || object.charAt(object.length() - 1) != ']') { throw new IllegalArgumentException("Unable to parse calendar: " + object); } TimeZone zone = TimeZone.getTimeZone(object.substring(30, obj...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public Calendar unmarshal(String object) { if (object.length() < 31 || object.charAt(26) != ':' || object.charAt(29) != '[' || object.charAt(object.length() - 1) != ']') { throw new IllegalArgumentException("U...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public Calendar unmarshal(String object) { if (object.length() < 31 || object.charAt(26) != ':' || object.charAt(29) != '[' || object.charAt(object.length() - 1) != ']') { throw new IllegalArgumentException("U...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public Calendar unmarshal(String object) { if (object.length() < 31 || object.charAt(26) != ':' || object.charAt(29) != '[' || object.charAt(object.length() - 1) != ']') { throw new IllegalArgumentException("U...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public Calendar unmarshal(String object) { if (object.length() < 31 || object.charAt(26) != ':' || object.charAt(29) != '[' || object.charAt(object.length() - 1) != ']') { throw new IllegalArgumentException("U...
@Test public void testMarshal() { Calendar cal = new GregorianCalendar(); cal.setTimeZone(TimeZone.getTimeZone("Europe/London")); cal.setTimeInMillis(0); cal.set(2000, 10, 1, 23, 45); assertEquals("2000-11-01T23:45:00.000+00:00[Europe/London]", BINDING.marshal(cal)); }
@Override public String marshal(Calendar object) { if (object instanceof GregorianCalendar) { GregorianCalendar cal = (GregorianCalendar) object; DATE_FORMAT.get().setCalendar(cal); String str = DATE_FORMAT.get().format(cal.getTime()); String printableDateString = str.substring(0, 26) + ":" + str.substring(26) + "[" + ...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public String marshal(Calendar object) { if (object instanceof GregorianCalendar) { GregorianCalendar cal = (GregorianCalendar) object; DATE_FORMAT.get().setCalendar(cal); String str = DATE_FORMAT.get().format...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public String marshal(Calendar object) { if (object instanceof GregorianCalendar) { GregorianCalendar cal = (GregorianCalendar) object; DATE_FORMAT.get().setCalendar(cal); String str = DATE_FORMAT.get().format...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public String marshal(Calendar object) { if (object instanceof GregorianCalendar) { GregorianCalendar cal = (GregorianCalendar) object; DATE_FORMAT.get().setCalendar(cal); String str = DATE_FORMAT.get().format...
CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> { @Override public String marshal(Calendar object) { if (object instanceof GregorianCalendar) { GregorianCalendar cal = (GregorianCalendar) object; DATE_FORMAT.get().setCalendar(cal); String str = DATE_FORMAT.get().format...
@Test public void testConstructionBlankServerUri() throws MqttException { thrown.expect(IllegalArgumentException.class); thrown.expectMessage(EXCEPTION_MESSAGE_SERVER_URI); new PahoAsyncMqttClientService(VALUE_BLANK, BrokerHelper.getClientId(), MqttClientConnectionType.PUBSUB, null); }
@Override public String getClientId() { return mqttClient.getClientId(); }
PahoAsyncMqttClientService extends AbstractMqttClientService implements MqttClientService, MqttCallbackExtended, IMqttActionListener { @Override public String getClientId() { return mqttClient.getClientId(); } }
PahoAsyncMqttClientService extends AbstractMqttClientService implements MqttClientService, MqttCallbackExtended, IMqttActionListener { @Override public String getClientId() { return mqttClient.getClientId(); } PahoAsyncMqttClientService(final String serverUri, final String clientId, final MqttClientConnectionTy...
PahoAsyncMqttClientService extends AbstractMqttClientService implements MqttClientService, MqttCallbackExtended, IMqttActionListener { @Override public String getClientId() { return mqttClient.getClientId(); } PahoAsyncMqttClientService(final String serverUri, final String clientId, final MqttClientConnectionTy...
PahoAsyncMqttClientService extends AbstractMqttClientService implements MqttClientService, MqttCallbackExtended, IMqttActionListener { @Override public String getClientId() { return mqttClient.getClientId(); } PahoAsyncMqttClientService(final String serverUri, final String clientId, final MqttClientConnectionTy...
@Test public void testGetSubscribedTopicSubscriptions() { Assert.assertArrayEquals(new String[0], TopicSubscriptionHelper.getSubscribedTopicFilters(topicSubscriptions)); topicSubscriptions.get(0).setSubscribed(true); Assert.assertArrayEquals(new String[]{ TOPIC_FILTER_1}, TopicSubscriptionHelper.getSubscribedTopicFilte...
public static String[] getSubscribedTopicFilters(List<TopicSubscription> topicSubscriptions) { List<String> records = new ArrayList<String>(); if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { if (topicSubscription.isSubscribed()) { records.add(topicSub...
TopicSubscriptionHelper { public static String[] getSubscribedTopicFilters(List<TopicSubscription> topicSubscriptions) { List<String> records = new ArrayList<String>(); if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { if (topicSubscription.isSubscribed...
TopicSubscriptionHelper { public static String[] getSubscribedTopicFilters(List<TopicSubscription> topicSubscriptions) { List<String> records = new ArrayList<String>(); if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { if (topicSubscription.isSubscribed...
TopicSubscriptionHelper { public static String[] getSubscribedTopicFilters(List<TopicSubscription> topicSubscriptions) { List<String> records = new ArrayList<String>(); if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { if (topicSubscription.isSubscribed...
TopicSubscriptionHelper { public static String[] getSubscribedTopicFilters(List<TopicSubscription> topicSubscriptions) { List<String> records = new ArrayList<String>(); if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { if (topicSubscription.isSubscribed...
@Test public void testMarkUnsubscribedEmptyTopicSubscriptions() { TopicSubscriptionHelper.markUnsubscribed(new ArrayList<TopicSubscription>()); }
public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } }
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } }
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } }
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } static TopicSubscription findByTopicFilter(final...
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } static TopicSubscription findByTopicFilter(final...
@Test public void testMarkUnsubscribed() { Assert.assertArrayEquals(new String[0], TopicSubscriptionHelper.getSubscribedTopicFilters(topicSubscriptions)); topicSubscriptions.get(0).setSubscribed(true); Assert.assertArrayEquals(new String[]{ TOPIC_FILTER_1}, TopicSubscriptionHelper.getSubscribedTopicFilters(topicSubscri...
public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } }
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } }
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } }
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } static TopicSubscription findByTopicFilter(final...
TopicSubscriptionHelper { public static void markUnsubscribed(List<TopicSubscription> topicSubscriptions) { if (!CollectionUtils.isEmpty(topicSubscriptions)) { for (TopicSubscription topicSubscription : topicSubscriptions) { topicSubscription.setSubscribed(false); } } } static TopicSubscription findByTopicFilter(final...
@Test public void testTopicHeader() { Assert.assertNull(MqttHeaderHelper.getTopicHeaderValue(null)); MessageBuilder<String> builder = MessageBuilder.withPayload("See topic header"); Assert.assertNull(MqttHeaderHelper.getTopicHeaderValue(builder.build())); builder.setHeader(MqttHeaderHelper.TOPIC, TOPIC); Assert.assertE...
public static String getTopicHeaderValue(Message<?> message) { String value = null; if (message != null && message.getHeaders().containsKey(TOPIC)) { value = message.getHeaders().get(TOPIC, String.class); } return value; }
MqttHeaderHelper { public static String getTopicHeaderValue(Message<?> message) { String value = null; if (message != null && message.getHeaders().containsKey(TOPIC)) { value = message.getHeaders().get(TOPIC, String.class); } return value; } }
MqttHeaderHelper { public static String getTopicHeaderValue(Message<?> message) { String value = null; if (message != null && message.getHeaders().containsKey(TOPIC)) { value = message.getHeaders().get(TOPIC, String.class); } return value; } }
MqttHeaderHelper { public static String getTopicHeaderValue(Message<?> message) { String value = null; if (message != null && message.getHeaders().containsKey(TOPIC)) { value = message.getHeaders().get(TOPIC, String.class); } return value; } static String getTopicHeaderValue(Message<?> message); static MqttQualityOfSe...
MqttHeaderHelper { public static String getTopicHeaderValue(Message<?> message) { String value = null; if (message != null && message.getHeaders().containsKey(TOPIC)) { value = message.getHeaders().get(TOPIC, String.class); } return value; } static String getTopicHeaderValue(Message<?> message); static MqttQualityOfSe...
@Test public void testMqttQualityOfServiceHeader() { Assert.assertEquals(MqttQualityOfService.QOS_2, MqttHeaderHelper.getMqttQualityOfServiceHeaderValue(null, MqttQualityOfService.QOS_2.getLevelIdentifier())); MessageBuilder<String> builder = MessageBuilder.withPayload("See QoS header"); Assert.assertEquals(MqttQuality...
public static MqttQualityOfService getMqttQualityOfServiceHeaderValue(Message<?> message, int defaultLevelIdentifier) { Integer levelIdentifier = defaultLevelIdentifier; try { if (message != null && message.getHeaders().containsKey(QOS)) { levelIdentifier = message.getHeaders().get(QOS, Integer.class); } } catch (Illeg...
MqttHeaderHelper { public static MqttQualityOfService getMqttQualityOfServiceHeaderValue(Message<?> message, int defaultLevelIdentifier) { Integer levelIdentifier = defaultLevelIdentifier; try { if (message != null && message.getHeaders().containsKey(QOS)) { levelIdentifier = message.getHeaders().get(QOS, Integer.class...
MqttHeaderHelper { public static MqttQualityOfService getMqttQualityOfServiceHeaderValue(Message<?> message, int defaultLevelIdentifier) { Integer levelIdentifier = defaultLevelIdentifier; try { if (message != null && message.getHeaders().containsKey(QOS)) { levelIdentifier = message.getHeaders().get(QOS, Integer.class...
MqttHeaderHelper { public static MqttQualityOfService getMqttQualityOfServiceHeaderValue(Message<?> message, int defaultLevelIdentifier) { Integer levelIdentifier = defaultLevelIdentifier; try { if (message != null && message.getHeaders().containsKey(QOS)) { levelIdentifier = message.getHeaders().get(QOS, Integer.class...
MqttHeaderHelper { public static MqttQualityOfService getMqttQualityOfServiceHeaderValue(Message<?> message, int defaultLevelIdentifier) { Integer levelIdentifier = defaultLevelIdentifier; try { if (message != null && message.getHeaders().containsKey(QOS)) { levelIdentifier = message.getHeaders().get(QOS, Integer.class...
@Test public void testRetainedHeader() { Assert.assertFalse(MqttHeaderHelper.getRetainedHeaderValue(null)); MessageBuilder<String> builder = MessageBuilder.withPayload("See retained header"); Assert.assertFalse(MqttHeaderHelper.getRetainedHeaderValue(builder.build())); builder.setHeader(MqttHeaderHelper.RETAINED, "foo"...
public static boolean getRetainedHeaderValue(Message<?> message) { boolean retained = false; try { if (message != null && message.getHeaders().containsKey(RETAINED)) { retained = message.getHeaders().get(RETAINED, Boolean.class); } } catch (IllegalArgumentException ex) { LOG.debug("Could not convert the RETAINED header...
MqttHeaderHelper { public static boolean getRetainedHeaderValue(Message<?> message) { boolean retained = false; try { if (message != null && message.getHeaders().containsKey(RETAINED)) { retained = message.getHeaders().get(RETAINED, Boolean.class); } } catch (IllegalArgumentException ex) { LOG.debug("Could not convert ...
MqttHeaderHelper { public static boolean getRetainedHeaderValue(Message<?> message) { boolean retained = false; try { if (message != null && message.getHeaders().containsKey(RETAINED)) { retained = message.getHeaders().get(RETAINED, Boolean.class); } } catch (IllegalArgumentException ex) { LOG.debug("Could not convert ...
MqttHeaderHelper { public static boolean getRetainedHeaderValue(Message<?> message) { boolean retained = false; try { if (message != null && message.getHeaders().containsKey(RETAINED)) { retained = message.getHeaders().get(RETAINED, Boolean.class); } } catch (IllegalArgumentException ex) { LOG.debug("Could not convert ...
MqttHeaderHelper { public static boolean getRetainedHeaderValue(Message<?> message) { boolean retained = false; try { if (message != null && message.getHeaders().containsKey(RETAINED)) { retained = message.getHeaders().get(RETAINED, Boolean.class); } } catch (IllegalArgumentException ex) { LOG.debug("Could not convert ...
@Test public void testCorrelationIdHeader() { Assert.assertNull(MqttHeaderHelper.getCorrelationIdHeaderValue(null)); MessageBuilder<String> builder = MessageBuilder.withPayload("See Correlation ID header"); Assert.assertNull(MqttHeaderHelper.getCorrelationIdHeaderValue(builder.build())); builder.setHeader(MqttHeaderHel...
public static String getCorrelationIdHeaderValue(Message<?> message) { String correlationId = null; if (message != null && message.getHeaders().containsKey(CORRELATION_ID)) { correlationId = message.getHeaders().get(CORRELATION_ID, String.class); } return correlationId; }
MqttHeaderHelper { public static String getCorrelationIdHeaderValue(Message<?> message) { String correlationId = null; if (message != null && message.getHeaders().containsKey(CORRELATION_ID)) { correlationId = message.getHeaders().get(CORRELATION_ID, String.class); } return correlationId; } }
MqttHeaderHelper { public static String getCorrelationIdHeaderValue(Message<?> message) { String correlationId = null; if (message != null && message.getHeaders().containsKey(CORRELATION_ID)) { correlationId = message.getHeaders().get(CORRELATION_ID, String.class); } return correlationId; } }
MqttHeaderHelper { public static String getCorrelationIdHeaderValue(Message<?> message) { String correlationId = null; if (message != null && message.getHeaders().containsKey(CORRELATION_ID)) { correlationId = message.getHeaders().get(CORRELATION_ID, String.class); } return correlationId; } static String getTopicHeade...
MqttHeaderHelper { public static String getCorrelationIdHeaderValue(Message<?> message) { String correlationId = null; if (message != null && message.getHeaders().containsKey(CORRELATION_ID)) { correlationId = message.getHeaders().get(CORRELATION_ID, String.class); } return correlationId; } static String getTopicHeade...
@Test public void testPublishConnectedEventNullApplicationEventPublisher() { mqttClientEventPublisher.publishConnectedEvent(CLIENT_ID, SERVER_URI, SUBSCRIBED_TOPICS_EMPTY, null, this); }
public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverUri, subscribedTopics, sourc...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
@Test public void testPublishConnectedEventNullClientId() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage(EXCEPTION_MESSAGE_CLIENT_ID); ApplicationEventPublisher applicationEventPublisher = Mockito .mock(ApplicationEventPublisher.class); mqttClientEventPublisher.publishConnectedEvent(null, SERVER_...
public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverUri, subscribedTopics, sourc...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
@Test public void testPublishConnectedEventNullServerUri() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("'serverUri' must be set!"); ApplicationEventPublisher applicationEventPublisher = Mockito .mock(ApplicationEventPublisher.class); mqttClientEventPublisher.publishConnectedEvent(CLIENT_ID, nu...
public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverUri, subscribedTopics, sourc...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...
MqttClientEventPublisher { public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics, ApplicationEventPublisher applicationEventPublisher, Object source) { if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new MqttClientConnectedEvent(clientId, serverU...