Skip navigation links


com.fatwire.assetapi.query
Class SimpleQuery

java.lang.Object
  extended by com.fatwire.assetapi.query.SimpleQuery

All Implemented Interfaces:
Query

public class SimpleQuery
extends java.lang.Object
implements Query

This class presents a helpful way to create Queries based on commonly used patterns.


Constructor Summary
SimpleQuery(Query query)
          Constructs a Simple query from a query; Query cannot be null, if null is specified, a NullPointerException will be thrown
SimpleQuery(java.lang.String assetType, java.lang.String subtype)
          Builds Query with asset type.
SimpleQuery(java.lang.String assetType, java.lang.String subtype, Condition cond, java.util.List<java.lang.String> attributeNames)
          Builds a Query for an asset type, a Condition and a List of attributes.
SimpleQuery(java.lang.String assetType, java.lang.String subtype, Condition cond, java.util.List<java.lang.String> attributeNames, java.util.List<SortOrder> sortOrder)
          Builds a Query for an asset type, a Condition, and a List of attributes where results are sorted.

 

Method Summary
 java.lang.String getAssetType()
          Returns asset type this query is built for
 java.util.List<java.lang.String> getAttributeNames()
          Lists name of the attributes requested in the Query
 Condition getCondition()
          Returns Condition for this Query, if any,
 QueryProperties getProperties()
          Gets properties associated with this Query instance.
 java.util.List<SortOrder> getSortOrder()
          Returns list of SortOrders.
 java.lang.String getSubtype()
          Returns asset type this query is built for
 void setAttributes(java.util.List<java.lang.String> attributeNames)
          Sets(resets) the names of attributes this Query uses.
 void setCondition(Condition cond)
          Sets(resets) Condition used for this query
 void setProperties(QueryProperties props)
          Sets(resets) properties associated with this Query instance.
 void setSortOrder(java.util.List<SortOrder> sort)
          Sets(resets) sort order to be used in this Query.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

SimpleQuery

public SimpleQuery(Query query)
Constructs a Simple query from a query; Query cannot be null, if null is specified, a NullPointerException will be thrown
Parameters:
query - the Query that we will use to constructs the SimpleQuery; NULLPointerException will be thrown if query is null

SimpleQuery

public SimpleQuery(java.lang.String assetType,
                   java.lang.String subtype)
Builds Query with asset type. This query will result in all assets instances returned including all multi lingual assets.
Parameters:
assetType - name of the asset type

SimpleQuery

public SimpleQuery(java.lang.String assetType,
                   java.lang.String subtype,
                   Condition cond,
                   java.util.List<java.lang.String> attributeNames)
Builds a Query for an asset type, a Condition and a List of attributes. This query results in asset instances containing only the requested attributes satisfying a given Condition. To retrive all attributes, pass null for attributeNames and set the QueryProperties of this instance to read all attributes.
Parameters:
assetType - Name of the asset type
cond - data Condition to be satisfied by returning data
attributeNames - names of the attributes that will be made part of the result.

SimpleQuery

public SimpleQuery(java.lang.String assetType,
                   java.lang.String subtype,
                   Condition cond,
                   java.util.List<java.lang.String> attributeNames,
                   java.util.List<SortOrder> sortOrder)
Builds a Query for an asset type, a Condition, and a List of attributes where results are sorted. This query results in asset instances containing only the requested attributes satisfying a given Condition. Sorted based on specified list of SortOrder
Parameters:
assetType - Name of the asset type
cond - data Condition to be satisfied by returning data
attributeNames - names of the attributes that will be made part of the result.
sortOrder - Sorting criteria.

Method Detail

getAssetType

public java.lang.String getAssetType()
Returns asset type this query is built for
Specified by:
getAssetType in interface Query
Returns:
Name of the asset type this Query is built for

getSubtype

public java.lang.String getSubtype()
Returns asset type this query is built for
Specified by:
getSubtype in interface Query
Returns:
Name of the asset type this Query is built for

getCondition

public Condition getCondition()
Returns Condition for this Query, if any,
Specified by:
getCondition in interface Query
Returns:
Condition used to build this Query

setCondition

public void setCondition(Condition cond)
Sets(resets) Condition used for this query
Parameters:
cond - the Condition that the Query contains

getAttributeNames

public java.util.List<java.lang.String> getAttributeNames()
Lists name of the attributes requested in the Query
Specified by:
getAttributeNames in interface Query
Returns:
List of attribute names

setAttributes

public void setAttributes(java.util.List<java.lang.String> attributeNames)
Sets(resets) the names of attributes this Query uses.
Parameters:
attributeNames - List of Attribute names

getSortOrder

public java.util.List<SortOrder> getSortOrder()
Returns list of SortOrders.
Specified by:
getSortOrder in interface Query
Returns:
List of SortOrders

setSortOrder

public void setSortOrder(java.util.List<SortOrder> sort)
Sets(resets) sort order to be used in this Query.
Parameters:
sort - List of SortOrder

getProperties

public QueryProperties getProperties()
Gets properties associated with this Query instance.
Specified by:
getProperties in interface Query
Returns:
properties

setProperties

public void setProperties(QueryProperties props)
Sets(resets) properties associated with this Query instance.
Parameters:
props - properties

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.