info.magnolia.voting.voters
Class IfVoter<T>
java.lang.Object
info.magnolia.voting.voters.BaseVoterImpl<T>
info.magnolia.voting.voters.IfVoter<T>
- Type Parameters:
T
- the type of object passed to vote
- All Implemented Interfaces:
- Voter<T>
public class IfVoter<T>
- extends BaseVoterImpl<T>
Conditional voter. If the "condition" voter is positive, returns the "then" voter's value,
otherwise returns the "otherwise" voter's value.
IfVoter
public IfVoter()
vote
public int vote(T value)
getCondition
public Voter<T> getCondition()
setCondition
public void setCondition(Voter<T> condition)
getThen
public Voter<T> getThen()
setThen
public void setThen(Voter<T> then)
getOtherwise
public Voter<T> getOtherwise()
setOtherwise
public void setOtherwise(Voter<T> otherwise)
toString
public String toString()
- Overrides:
toString
in class BaseVoterImpl<T>
Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.