
1 changed files with 5 additions and 4 deletions
@ -1,11 +1,12 @@ |
|||
package foundation.pEp.jniadapter; |
|||
import java.util.concurrent.atomic.AtomicLong; |
|||
|
|||
abstract class UniquelyIdentifiable { |
|||
static final AtomicLong NEXT_ID = new AtomicLong(1); |
|||
final long id = NEXT_ID.getAndIncrement(); |
|||
// Abstract here so you can only inherit from, but not instantiate
|
|||
abstract public class UniquelyIdentifiable { |
|||
private static final AtomicLong NEXT_ID = new AtomicLong(1); |
|||
private final long id = NEXT_ID.getAndIncrement(); |
|||
|
|||
public long getId() { |
|||
protected long getId() { |
|||
return id; |
|||
} |
|||
} |
|||
|
Loading…
Reference in new issue