Esempio n. 1
0
 /**
  * create a new access right of a user for a program.
  *
  * @param user that will get a read/write permission, not null
  * @param program the program affected, not null
  * @param relation read or write permission
  */
 public AccessRight(User user, Program program, Relation relation) {
   Assert.notNull(user);
   Assert.notNull(program);
   Assert.notNull(relation);
   this.user = user;
   this.program = program;
   this.relation = relation;
 }
Esempio n. 2
0
 /**
  * create a new program
  *
  * @param name the name of the program, not null
  * @param owner the user who created and thus owns the program
  */
 public Program(String name, User owner, Robot robot) {
   Assert.notNull(name);
   Assert.notNull(owner);
   this.name = name;
   this.owner = owner;
   this.robot = robot;
   this.created = Util1.getNow();
   this.lastChanged = Util1.getNow();
 }
 private MotorStopAction(
     IActorPort port,
     IMotorStopMode mode,
     BlocklyBlockProperties properties,
     BlocklyComment comment) {
   super(port, BlockTypeContainer.getByName("MOTOR_STOP_ACTION"), properties, comment);
   Assert.isTrue(port != null && mode != null);
   this.mode = mode;
   setReadOnly();
 }
Esempio n. 4
0
 private ListGetIndex(
     ListElementOperations mode,
     IndexLocation name,
     List<Expr<V>> param,
     BlocklyBlockProperties properties,
     BlocklyComment comment) {
   super(BlockType.LIST_INDEX_OF, properties, comment);
   Assert.isTrue(mode != null && name != null && param != null);
   this.mode = mode;
   this.location = name;
   this.param = param;
   setReadOnly();
 }
Esempio n. 5
0
 /** @return list with elements of type {@link Stmt}. */
 public final List<Stmt<V>> get() {
   Assert.isTrue(isReadOnly());
   return Collections.unmodifiableList(this.sl);
 }
Esempio n. 6
0
 /**
  * Add new element to the list.
  *
  * @param stmt
  */
 public final void addStmt(Stmt<V> stmt) {
   Assert.isTrue(mayChange() && stmt != null && stmt.isReadOnly());
   this.sl.add(stmt);
 }
Esempio n. 7
0
 public final void setT(BeanTesterSuccess t) {
   this.t = t;
   Assert.isTrue(!this.readOnly);
 }
Esempio n. 8
0
 public final void setS(String s) {
   Assert.isTrue(!this.readOnly);
   this.s = s;
 }
Esempio n. 9
0
 public final void setI(int i) {
   Assert.isTrue(!this.readOnly);
   this.i = i;
 }