/** Sets the given object. If the object has already been set, an exception is thrown. */ public final void set(T obj) { if (set.compareAndSet(false, true)) { this.obj = obj; } else { throw new AlreadySetException(); } }
/** Sets the given object. If the object has already been set, an exception is thrown. */ public final void set(T obj) { if (set.compareAndSet(false, true)) { this.obj = obj; } else { throw new AlreadySetException(); } }
/** Sets the given object. If the object has already been set, an exception is thrown. */ public final void set(T obj) { if (set.compareAndSet(false, true)) { this.obj = obj; } else { throw new AlreadySetException(); } }
/** Sets the given object. If the object has already been set, an exception is thrown. */ public final void set(T obj) { if (set.compareAndSet(false, true)) { this.obj = obj; } else { throw new AlreadySetException(); } }