Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.service.cmr.repository
Class TransformationOptionPair
java.lang.Object
  org.alfresco.service.cmr.repository.TransformationOptionPair
All Implemented Interfaces:
Serializable

@org.alfresco.api.AlfrescoPublicApi
public class TransformationOptionPair
extends Object
implements Serializable
A pair of transformation options that specify A) a max value over which the source is not read (throws an Exception) or B) a limit over which no more of the source is read (returns EOF) Each pair represents a values such as an elapse time, KBytes read or number of pages read. It is only meaningful for a either the max or limit value to be set. There is one pair of values for each transformer and another pair passed in via the options parameter for each individual transformation. The later is for specific types of transformation, such as thumbnail generation. When this occurs values are combined, by using the lowest of the four values.
Author:
Alan Davis
See Also:
Serialized Form

Nested Class Summary
static enum
TransformationOptionPair.Action
          Action to take place for a given pair of values.
Constructor Summary
TransformationOptionPair()
Method Summary
void
append(StringBuilder sb, String optMaxKey, String optLimitKey)
combine(TransformationOptionPair that)
          Returns a TransformationOptionPair that has getter methods that combine the the values from the getter methods of this and the supplied TransformationOptionPair.
combineUpper(TransformationOptionPair that)
          Returns a TransformationOptionPair that has getter methods that combine the the values from the getter methods of this and the supplied TransformationOptionPair so that they return the lowest common denominator of the two limits .
void
defaultTo(TransformationOptionPair pair)
           This method overrides rather than defaults values into the supplied pair (as the name might suggest), but because of the order in which it is called, this results in the correct defaults being set.
boolean
equals(Object obj)
getAction()
long
getLimit()
long
getMax()
long
getValue()
int
hashCode()
void
set(Map<String,Object> optionsMap, String optMaxKey, String optLimitKey, String exceptionMessage)
void
setLimit(long limit, String exceptionMessage)
void
setMax(long max, String exceptionMessage)
boolean
supported()
          Indicates if the limit allows a transformation to take place at all.
toMap(Map<String,Object> optionsMap, String optMaxKey, String optLimitKey)
toString(String max, String limit)
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
TransformationOptionPair
public TransformationOptionPair()
Method Detail
getMax
public long getMax()

setMax
public void setMax(long max,
                   String exceptionMessage)

getLimit
public long getLimit()

setLimit
public void setLimit(long limit,
                     String exceptionMessage)

getValue
public long getValue()

supported
public boolean supported()
Indicates if the limit allows a transformation to take place at all. If 0, it would not be possible.
Returns:
true if a transformation is possible.

getAction
public TransformationOptionPair.Action getAction()

defaultTo
public void defaultTo(TransformationOptionPair pair)
This method overrides rather than defaults values into the supplied pair (as the name might suggest), but because of the order in which it is called, this results in the correct defaults being set.

A call to this method overrides any values in the supplied pair parameter with those in this Object. The supplied pair parameter is being gradually built up by initially setting the most general values and then more specific values for each level. As a result 'default' values from the more general levels will still exist at the end if more specific ones have not been supplied.

Parameters:
pair - to be set

toString
public String toString(String max,
                       String limit)

toMap
public Map<String,ObjecttoMap(Map<String,Object> optionsMap,
                                String optMaxKey,
                                String optLimitKey)

append
public void append(StringBuilder sb,
                   String optMaxKey,
                   String optLimitKey)

set
public void set(Map<String,Object> optionsMap,
                String optMaxKey,
                String optLimitKey,
                String exceptionMessage)

combine
public TransformationOptionPair combine(TransformationOptionPair that)
Returns a TransformationOptionPair that has getter methods that combine the the values from the getter methods of this and the supplied TransformationOptionPair.

combineUpper
public TransformationOptionPair combineUpper(TransformationOptionPair that)
Returns a TransformationOptionPair that has getter methods that combine the the values from the getter methods of this and the supplied TransformationOptionPair so that they return the lowest common denominator of the two limits .

hashCode
public int hashCode()
Overrides:
hashCode in class Object

equals
public boolean equals(Object obj)
Overrides:
equals in class Object

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2018 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.