All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.backendless.persistence.QueryOptionsBuilder Maven / Gradle / Ivy

There is a newer version: 7.0-alpha
Show newest version
package com.backendless.persistence;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

class QueryOptionsBuilder
{
  private List sortBy;
  private List related;
  private Integer relationsDepth;
  private Builder builder;

  QueryOptionsBuilder( Builder builder )
  {
    sortBy = new ArrayList<>();
    related = new ArrayList<>();
    this.builder = builder;
  }
  
  QueryOptions build()
  {
    QueryOptions queryOptions = new QueryOptions();
    queryOptions.setRelated( related );
    queryOptions.setRelationsDepth( relationsDepth );
    queryOptions.setSortBy( sortBy );
    return queryOptions;
  }
  
  /*--- Auto-generated code ---*/

  public List getSortBy()
  {
    return sortBy;
  }

  public Builder setSortBy( List sortBy )
  {
    this.sortBy = sortBy;
    return builder;
  }

  public Builder setSortBy( String... sortBy )
  {
    Collections.addAll( this.sortBy, sortBy );
    return builder;
  }

  public Builder addSortBy( String sortBy )
  {
    this.sortBy.add( sortBy );
    return builder;
  }

  public List getRelated()
  {
    return related;
  }

  public Builder setRelated( List related )
  {
    this.related = related;
    return builder;
  }

  public Builder setRelated( String... related )
  {
    Collections.addAll( this.related, related );
    return builder;
  }

  public Integer getRelationsDepth()
  {
    return relationsDepth;
  }

  public Builder setRelationsDepth( Integer relationsDepth )
  {
    this.relationsDepth = relationsDepth;
    return builder;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy