pub struct GenericId<T>(pub i64, pub PhantomData<T>);
pub struct PhantomMyId;
pub type MyId = GenericId<PhantomMyId>;
pub struct PhantomOtherId;
pub type OtherId = GenericId<PhantomOtherId>;
pub fn foo(my_id: &MyId){
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person { | |
private final String username; | |
private final int age; | |
Person(PersonBuilder personBuilder) { | |
this.username = personBuilder.username; | |
this.age = personBuilder.age; | |
} |