1 24 package org.objectweb.jalisto.se.impl.meta.comparator; 25 26 import java.util.Collection ; 27 28 public class CollectionComparator extends DefaultComparator { 29 30 public boolean contains(Object candidate, Object value) { 31 return ((Collection ) candidate).contains(value); 32 } 33 34 public boolean endsWith(Object candidate, Object value) { 35 Collection c = (Collection ) candidate; 36 return c.toArray()[c.size() - 1].equals(value); 37 } 38 39 public boolean startsWith(Object candidate, Object value) { 40 Collection c = (Collection ) candidate; 41 return c.toArray()[0].equals(value); 42 } 43 44 static final long serialVersionUID = -7589300697964798159L; 45 } 46 | Popular Tags |