Package org.apache.commons.collections.functors

Examples of org.apache.commons.collections.functors.EqualPredicate


        super(name);
    }

    public void testEqual() {
        BeanPredicate predicate =
            new BeanPredicate("stringProperty",new EqualPredicate("foo"));
        assertTrue(predicate.evaluate(new TestBean("foo")));
        assertTrue(!predicate.evaluate(new TestBean("bar")));
    }
View Full Code Here


        assertTrue(!predicate.evaluate(new TestBean("bar")));
    }

    public void testNotEqual() {
        BeanPredicate predicate =
            new BeanPredicate("stringProperty",new NotPredicate( new EqualPredicate("foo")));
        assertTrue(!predicate.evaluate(new TestBean("foo")));
        assertTrue(predicate.evaluate(new TestBean("bar")));
    }
View Full Code Here

        super(name);
    }

    public void testEqual() {
        BeanPredicate predicate =
            new BeanPredicate("stringProperty",new EqualPredicate("foo"));
        assertTrue(predicate.evaluate(new TestBean("foo")));
        assertTrue(!predicate.evaluate(new TestBean("bar")));
    }
View Full Code Here

        assertTrue(!predicate.evaluate(new TestBean("bar")));
    }

    public void testNotEqual() {
        BeanPredicate predicate =
            new BeanPredicate("stringProperty",new NotPredicate( new EqualPredicate("foo")));
        assertTrue(!predicate.evaluate(new TestBean("foo")));
        assertTrue(predicate.evaluate(new TestBean("bar")));
    }
View Full Code Here

        if(portletDefinition != null &&  StringUtils.isNotBlank(portletDefinition.getFName())) {
            String functionalName = portletDefinition.getFName();
            List<IUserLayoutNodeDescription> favoritePortlets = FavoritesUtils.getFavoritePortlets(ulm.getUserLayout());
           
            //search for the favorite to delete
            EqualPredicate nameEqlPredicate = new EqualPredicate(functionalName);
            Object result = CollectionUtils.find(favoritePortlets, new BeanPredicate("functionalName",nameEqlPredicate));
           
            if(result != null && result instanceof UserLayoutChannelDescription) {
                UserLayoutChannelDescription channelDescription = (UserLayoutChannelDescription)result;
                try {
View Full Code Here

        int result = JOptionPane.showOptionDialog(getTable(),"Remove target of probe as well?","Remove probe",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null); //$NON-NLS-1$ //$NON-NLS-2$
        switch (result) {
          case JOptionPane.CANCEL_OPTION:           
            break;
          case JOptionPane.YES_OPTION:
            probemaker.removeTargetsForProbes(new EqualPredicate(s));
            probemaker.removeProbes(new EqualPredicate(s));
            break;
          case JOptionPane.NO_OPTION:
            probemaker.removeProbes(new EqualPredicate(s));
            break;
        }       
      }   
    });   
 
View Full Code Here

        super(name);
    }

    public void testEqual() {
        BeanPredicate predicate =
            new BeanPredicate("stringProperty",new EqualPredicate("foo"));
        assertTrue(predicate.evaluate(new TestBean("foo")));
        assertTrue(!predicate.evaluate(new TestBean("bar")));
    }
View Full Code Here

        assertTrue(!predicate.evaluate(new TestBean("bar")));
    }

    public void testNotEqual() {
        BeanPredicate predicate =
            new BeanPredicate("stringProperty",new NotPredicate( new EqualPredicate("foo")));
        assertTrue(!predicate.evaluate(new TestBean("foo")));
        assertTrue(predicate.evaluate(new TestBean("bar")));
    }
View Full Code Here

        int result = JOptionPane.showOptionDialog(getTable(),"Remove target of probe as well?","Remove probe",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null); //$NON-NLS-1$ //$NON-NLS-2$
        switch (result) {
          case JOptionPane.CANCEL_OPTION:           
            break;
          case JOptionPane.YES_OPTION:
            probemaker.removeTargetsForProbes(new EqualPredicate(s));
            probemaker.removeProbes(new EqualPredicate(s));
            break;
          case JOptionPane.NO_OPTION:
            probemaker.removeProbes(new EqualPredicate(s));
            break;
        }       
      }   
    });   
 
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.functors.EqualPredicate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.