"WEBNMS_5 API Docs"

com.adventnet.nms.poll
Class StringCompare

java.lang.Object
  extended by com.adventnet.nms.poll.Compare
      extended by com.adventnet.nms.poll.StringCompare
All Implemented Interfaces:
java.io.Serializable

public class StringCompare
extends Compare

The basic class for making string type comparisions for any ManagedObject property. An instance of this class has the property to be checked , the condiiton to be satisfied and the value it must satisfy. Any string property of (@link com.adventnet.nms.topodb.ManagedObject ManagedObject) , it's derived classes or it's user classes can be passed through the checkProperty() method to check if the ManagedObject property satisfies the given condition.

Note that the property name should match exactly the property present in a ManagedObject in case.

This class forms a part of match criteria section of a PollingObject.

Since:
2.3
Version:
1.0
See Also:
NumericCompare, PollingObject, ManagedObject, Serialized Form

Constructor Summary
StringCompare()
          Creates a new StringCompare instance.
StringCompare(java.lang.String prop, java.lang.String cond, java.lang.String val)
          Creates a new StringCompare instance.
 
Method Summary
 boolean checkProperty(ManagedObject mo)
          checks if the Property exists for this ManagedObject, if yes , checks if the property value satisfies the Condition when it is compared against the Value field.
 
Methods inherited from class com.adventnet.nms.poll.Compare
getCondition, getProperty, getType, getValue, setCondition, setProperty, setType, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringCompare

public StringCompare()
Creates a new StringCompare instance.


StringCompare

public StringCompare(java.lang.String prop,
                     java.lang.String cond,
                     java.lang.String val)
Creates a new StringCompare instance. The condition given can be any one of the following,
  • equals
  • notequals
  • equalsIgnoreCase
  • startsWith
  • doesNotStartWith
  • endsWith
  • doesNotEndWith
  • contains
  • doesNotContain

Parameters:
prop - Property of ManagedObject to be checked.
cond - the condition to be checked.
val - the value which the condition must satisfy.
Method Detail

checkProperty

public boolean checkProperty(ManagedObject mo)
checks if the Property exists for this ManagedObject, if yes , checks if the property value satisfies the Condition when it is compared against the Value field.

Specified by:
checkProperty in class Compare
Parameters:
mo - ManagedObject whose Property is to be checked.
Returns:
true if value of the Managed Object property satisfies the Condition when it is compared against the Value field, else false. If property to be compared does not exist in the ManagedObject,false is returned.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.