use of com.cinchapi.concourse.Link in project concourse by cinchapi.
the class ConcourseAccount method getOwners.
@Override
public Customer[] getOwners() {
Concourse concourse = Constants.CONCOURSE_CONNECTIONS.request();
try {
Set<Link> customerLinks = concourse.select("owners", id);
Customer[] owners = new Customer[customerLinks.size()];
int index = 0;
for (Link link : customerLinks) {
owners[index] = new ConcourseCustomer(link.longValue());
++index;
}
return owners;
} finally {
Constants.CONCOURSE_CONNECTIONS.release(concourse);
}
}
use of com.cinchapi.concourse.Link in project concourse by cinchapi.
the class ConvertTest method testConvertLinkFromIntValue.
@Test
public void testConvertLinkFromIntValue() {
// A int/long that is wrapped between two at (@) symbols must always
// convert to a Link
Number number = Random.getInt();
// must
String value = MessageFormat.format("{0}{1}", "@", number.toString());
// use
// number.toString()
// so
// comma
// separators
// are
// not
// added
// to
// the
// output
Link link = (Link) Convert.stringToJava(value);
Assert.assertEquals(number.intValue(), link.intValue());
}
use of com.cinchapi.concourse.Link in project concourse by cinchapi.
the class ConvertTest method testConvertLinkFromLongValue.
@Test
public void testConvertLinkFromLongValue() {
// A int/long that is wrapped between two at (@) symbols must always
// convert to a Link
Number number = Random.getLong();
// must
String value = MessageFormat.format("{0}{1}", "@", number.toString());
// use
// number.toString()
// so
// comma
// separators
// are
// not
// added
// to
// the
// output
Link link = (Link) Convert.stringToJava(value);
Assert.assertEquals(number.longValue(), link.longValue());
}
Aggregations