@SuppressWarnings("unchecked") @Override <T> T parseStr(String str, Class<T> cls) { return (T) new Bookmark(str); } };
@Deprecated public static Bookmark bookmarkFor(final String str) { return str != null? new Bookmark(str): null; }
@Configuration @ComponentScan @EnableAutoConfiguration public class Application { @Bean CommandLineRunner init(AccountRepository accountRepository, BookmarkRepository bookmarkRepository) { return (evt) -> Arrays.asList( "jhoeller,dsyer,pwebb,ogierke,rwinch,mfisher,mpollack,jlong".split(",")) .forEach( a -> { Account account = accountRepository.save(new Account(a, "password")); bookmarkRepository.save(new Bookmark(account, "http://bookmark.com/1/" + a, "A description")); bookmarkRepository.save(new Bookmark(account, "http://bookmark.com/2/" + a, "A description")); }); } public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
@Programmatic public Bookmark getTarget() { final String str = getTargetStr(); return str != null? new Bookmark(str): null; }
Bookmark bookmark = new Bookmark(); bookmark.id = cursor.getLong(cursor.getColumnIndex(Bookmark.ID)); bookmark.emag_id = cursor.getLong(cursor.getColumnIndex(Bookmark.EMAG_ID));
@Programmatic public P getPolymorphicReference() { final Bookmark bookmark = new Bookmark(getPolymorphicObjectType(), getPolymorphicIdentifier()); return (P) bookmarkService.lookup(bookmark, BookmarkService2.FieldResetPolicy.DONT_RESET); }
@Override public Bookmark bookmarkFor(Class<?> cls, String identifier) { final ObjectSpecification objectSpec = getSpecificationLoader().loadSpecification(cls); String objectType = objectSpec.getSpecId().asString(); return new Bookmark(objectType, identifier); }
@Test public void happy_case() throws Exception { String s = InteractionDtoUtils.deriveLogicalMemberId(new Bookmark("customer.Order", "1234"), "com.mycompany.customer.Order#placeOrder"); assertThat(s, is(equalTo("customer.Order#placeOrder"))); } }
private AdapterAndProperty(ObjectAdapter adapter, ObjectAssociation property) { this.objectAdapter = adapter; this.property = property; final RootOid oid = (RootOid) adapter.getOid(); final String objectType = oid.getObjectSpecId().asString(); final String identifier = oid.getIdentifier(); bookmark = new Bookmark(objectType, identifier); bookmarkStr = bookmark.toString(); propertyId = property.getId(); }
public static Bookmark from(final OidDto oidDto) { final BookmarkObjectState bookmarkObjectState = oidDto.getObjectState(); final ObjectState objectState = ObjectState.from(bookmarkObjectState); final String objectType = coalesce(oidDto.getType(), oidDto.getObjectType()); final String objectId = coalesce(oidDto.getId(), oidDto.getObjectIdentifier()); final Bookmark bookmark = new Bookmark(objectState.getCode() + objectType, objectId); return bookmark; }
UUID.randomUUID().toString(), 1, new Bookmark("CUS", "12345"), "John Customer", "com.mycompany.Customer#placeOrder", Arrays.<ParamDto>asList(), "freddyUser" ); InteractionDtoUtils.addParamArg(interactionDto, "nullJodaLocalTime", org.joda.time.LocalTime.class, (org.joda.time.LocalTime) null, null); InteractionDtoUtils.addParamArg(interactionDto, "aReference", null, new Bookmark("ORD", "12345"), null); InteractionDtoUtils.addParamArg(interactionDto, "nullReference", null, null, null);