@Test public void testOfEntity() { long id = 4711L; FooEto foo = new FooEto(); foo.setId(id); IdRef<Foo> fooId = IdRef.<Foo> of(foo); assertThat(fooId).isNotNull(); assertThat(fooId.getId()).isEqualTo(foo.getId()).isEqualTo(id); assertThat(fooId.toString()).isEqualTo(Long.toString(id)); assertThat(IdRef.of((Foo) null)).isNull(); Bar bar = new Bar(); bar.setFooId(fooId); IdRef<Bar> barId = IdRef.of(1234L); bar.setBarId(barId); }
public static <E extends GenericEntity<Long>> IdRef<E> of(E entity) { if (entity == null) { return null; } return of(entity.getId()); }
IdRef extends GenericIdRef<Long, E> { public static <E extends GenericEntity<Long>> IdRef<E> of(E entity) { if (entity == null) { return null; } return of(entity.getId()); } }
IdRef extends GenericIdRef<Long, E> { public static <E extends GenericEntity<Long>> IdRef<E> of(E entity) { if (entity == null) { return null; } return of(entity.getId()); } IdRef(Long id); }
IdRef extends GenericIdRef<Long, E> { public static <E extends GenericEntity<Long>> IdRef<E> of(E entity) { if (entity == null) { return null; } return of(entity.getId()); } IdRef(Long id); static IdRef<E> of(E entity); static IdRef<E> of(Long id); static IdRef<E> of(long id); }
IdRef extends GenericIdRef<Long, E> { public static <E extends GenericEntity<Long>> IdRef<E> of(E entity) { if (entity == null) { return null; } return of(entity.getId()); } IdRef(Long id); static IdRef<E> of(E entity); static IdRef<E> of(Long id); static IdRef<E> of(long id);  }