Beispiel #1
0
  public Group(
      final Office office,
      final Staff staff,
      final Group parent,
      final GroupLevel groupLevel,
      final String name,
      final String externalId,
      final GroupingTypeStatus status,
      final LocalDate activationDate,
      final Set<Client> clientMembers,
      final Set<Group> groupMembers) {
    this.office = office;
    this.staff = staff;
    this.groupLevel = groupLevel;
    this.parent = parent;

    if (parent != null) {
      this.parent.addChild(this);
    }

    this.status = status.getValue();
    if (activationDate != null) {
      this.activationDate = activationDate.toDate();
    }

    if (StringUtils.isNotBlank(name)) {
      this.name = name.trim();
    } else {
      this.name = null;
    }
    if (StringUtils.isNotBlank(externalId)) {
      this.externalId = externalId.trim();
    } else {
      this.externalId = null;
    }
    if (clientMembers != null) {
      this.clientMembers = clientMembers;
    }
    if (groupMembers != null) {
      this.groupMembers.addAll(groupMembers);
    }
  }