1 24 package org.objectweb.jalisto.se.impl.meta.comparator; 25 26 import org.objectweb.jalisto.se.api.query.FielComparator; 27 28 public class DefaultComparator implements FielComparator { 29 public boolean contains(Object candidate, Object value) { 30 return String.valueOf(candidate).indexOf(String.valueOf(value)) != -1; 31 } 32 33 public boolean equal(Object candidate, Object value) { 34 return candidate.equals(value); 35 } 36 37 public boolean greater(Object candidate, Object value) { 38 return false; 39 } 40 41 public boolean identity(Object candidate, Object value) { 42 return (candidate == value); 43 } 44 45 public boolean like(Object candidate, Object value) { 46 return candidate.equals(value); 47 } 48 49 public boolean smaller(Object candidate, Object value) { 50 return false; 51 } 52 53 public boolean startsWith(Object candidate, Object value) { 54 return String.valueOf(candidate).startsWith(String.valueOf(value)); 55 } 56 57 public boolean endsWith(Object candidate, Object value) { 58 return String.valueOf(candidate).endsWith(String.valueOf(value)); 59 } 60 61 62 static final long serialVersionUID = -7589008597964761459L; 63 } 64 | Popular Tags |