EN · DE · RU · FR · ES

#367: AddressbookFilter.java

projectforge-business/src/main/java/org/projectforge/business/address/AddressbookFilter.java Type: Java · Role: Component · Source: projectforge-business/src/main/java/org/projectforge/business/address/AddressbookFilter.java 149 lines · 72 code · 58 comments · 19 blank
Filter/search criteria bean for Addressbook queries. Extends BaseSearchFilter to provide typed query parameters for list views and Excel exports.

Code Structure

Package: org.projectforge.business.address

Classes: AddressbookFilter

Enums: OwnerType

Extends: BaseSearchFilter

Implements: Serializable

Methods (10): getOwnerType, setOwnerType, isAdmin, isAll, isOwn, isOthers, isReadonlyAccess, setReadonlyAccess, isFullAccess, setFullAccess

Fields (2): serialVersionUID, abOwner

Imports: 2 packages

Source Code (abridged)

package org.projectforge.business.address;

import org.projectforge.framework.persistence.api.BaseSearchFilter;

import java.io.Serializable;

/**
 * @author M. Lauterbach (m.lauterbach@micromata.de)
 */
public class AddressbookFilter extends BaseSearchFilter implements Serializable
{
  private static final long serialVersionUID = 7410573665085873058L;

  public enum OwnerType
  {
    ALL, OWN, OTHERS, ADMIN
  }

  private boolean fullAccess, readonlyAccess;

  protected OwnerType abOwner;

  public AddressbookFilter()
  {
    this(null);
  }

  public AddressbookFilter(final BaseSearchFilter filter)
  {
    super(filter);
    fullAccess = readonlyAccess = true;
    abOwner = OwnerType.ALL;
    if (filter instanceof AddressbookFilter) {
      final AddressbookFilter obj = (AddressbookFilter) filter;
      this.fullAccess = obj.isFullAccess();
      this.readonlyAccess = obj.isReadonlyAccess();
      this.abOwner = obj.getOwnerType();
    }
  }

  /**
   * @return the filterType
   */
  public OwnerType getOwnerType()
  {
    return abOwner;
  }

  /**
   * @param calOwner the filterType to set
   * @return this for chaining.
   */
  public AddressbookFilter setOwnerType(final OwnerType calOwner)
  {
    this.abOwner = calOwner;
    return this;
  }

  /**
   * @return true if calOwner == {@link OwnerType#ADMIN}
   */
  public boolean isAdmin()
  {
    return abOwner == OwnerType.ADMIN;
  }

  /**
   * @return true if calOwner == {@link OwnerType#OWN}
   */
  public boolean isAll()
  {
    return abOwner == OwnerType.ALL;
  }

  /**
   * @return true if calOwner == {@link OwnerType#OWN}
   */
  public boolean isOwn()
  {
    return abOwner == OwnerType.OWN;
  }

  /**
   * @return true if calOwner == {@link OwnerType#OTHERS}
   */
  public boolean isOthers()
  {
    return abOwner == OwnerType.OTHERS;
  }

  /**
   * @return the readonlyAccess
   */
  public boolean isReadonlyAccess()
  {
    return readonlyAccess;
  }

  /**
   * @param readonlyAccess the readOnlyAccess to set
   * @return this for chaining.
   */
  public AddressbookFilter setReadonlyAccess(final boolean readonlyAccess)
  {
    this.readonlyAccess = readonlyAccess;
    return this;
  }

  /**
   * @return the fullAccess
   */
  public boolean isFullAccess()
  {
    return fullAccess;
  }

  /**
   * @param fullAccess the fullAccess to set
   * @return this for chaining.
// ... (truncated, total 127 lines)

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022