@Test public void testOfLong() { long id = 4711L; IdRef<Foo> fooId = IdRef.of(id); assertThat(fooId).isNotNull(); assertThat(fooId.getId()).isEqualTo(id); assertThat(fooId.toString()).isEqualTo(Long.toString(id)); assertThat(IdRef.of(Long.valueOf(id))).isEqualTo(fooId).isNotSameAs(fooId); assertThat(IdRef.of((Long) null)).isNull(); }
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);  }