info.magnolia.voting.voters
Class IfVoter<T>

java.lang.Object
  extended by info.magnolia.voting.voters.BaseVoterImpl<T>
      extended by 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.


Constructor Summary
IfVoter()
           
 
Method Summary
 Voter<T> getCondition()
           
 Voter<T> getOtherwise()
           
 Voter<T> getThen()
           
 void setCondition(Voter<T> condition)
           
 void setOtherwise(Voter<T> otherwise)
           
 void setThen(Voter<T> then)
           
 String toString()
           
 int vote(T value)
           
 
Methods inherited from class info.magnolia.voting.voters.BaseVoterImpl
getName, isEnabled, setEnabled, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IfVoter

public IfVoter()
Method Detail

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.