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

java.lang.Object
  extended by info.magnolia.voting.voters.BaseVoterImpl<T>
      extended by info.magnolia.voting.voters.AbstractBoolVoter<T>
Type Parameters:
T - the type of object passed to vote
All Implemented Interfaces:
Voter<T>
Direct Known Subclasses:
AuthenticatedVoter, BasePatternVoter, DelegateVoter, DomainNameRegexVoter, DontDispatchOnForwardAttributeVoter, ExtensionVoter, FalseVoter, ForwardVoter, NotVoter, OnAdminVoter, PropertyVoter, RequestHasParametersVoter, ResponseContentTypeVoter, TrueVoter, UserAgentVoter

public abstract class AbstractBoolVoter<T>
extends BaseVoterImpl<T>

Used to create boolean voters which can't return integer values. You can stear the returned values by setting the trueValue and falseValue. To inverse the result of the boolVote method use the not property.


Constructor Summary
AbstractBoolVoter()
           
 
Method Summary
protected abstract  boolean boolVote(T value)
           
 int getFalseValue()
           
 int getLevel()
           
 int getTrueValue()
           
 boolean isNot()
           
 void setFalseValue(int negativeVoteValue)
           
 void setLevel(int level)
           
 void setNot(boolean not)
           
 void setTrueValue(int positiveVoteValue)
           
 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

AbstractBoolVoter

public AbstractBoolVoter()
Method Detail

vote

public int vote(T value)

getFalseValue

public int getFalseValue()

setFalseValue

public void setFalseValue(int negativeVoteValue)

getTrueValue

public int getTrueValue()

setTrueValue

public void setTrueValue(int positiveVoteValue)

boolVote

protected abstract boolean boolVote(T value)

isNot

public boolean isNot()

setNot

public void setNot(boolean not)

toString

public String toString()
Overrides:
toString in class BaseVoterImpl<T>

getLevel

public int getLevel()

setLevel

public void setLevel(int level)


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.