001package org.avaje.ebean.typequery; 002 003/** 004 * String property. 005 * 006 * @param <R> the root query bean type 007 */ 008public class PString<R> extends TQProperty<R> { 009 010 /** 011 * Construct with a property name and root instance. 012 * 013 * @param name property name 014 * @param root the root query bean instance 015 */ 016 public PString(String name, R root) { 017 super(name, root); 018 } 019 020 /** 021 * Construct with additional path prefix. 022 */ 023 public PString(String name, R root, String prefix) { 024 super(name, root, prefix); 025 } 026 027 /** 028 * Is equal to. 029 * 030 * @param value the equal to bind value 031 * @return the root query bean instance 032 */ 033 public R eq(String value) { 034 expr().eq(name, value); 035 return root; 036 } 037 038 /** 039 * Case insensitive is equal to. 040 * 041 * @param value the equal to bind value 042 * @return the root query bean instance 043 */ 044 public R ieq(String value) { 045 expr().ieq(name, value); 046 return root; 047 } 048 049 /** 050 * Is equal to. 051 * 052 * @param value the equal to bind value 053 * @return the root query bean instance 054 */ 055 public R equalTo(String value) { 056 expr().eq(name, value); 057 return root; 058 } 059 060 /** 061 * Case insensitive is equal to. 062 * 063 * @param value the equal to bind value 064 * @return the root query bean instance 065 */ 066 public R iequalTo(String value) { 067 expr().ieq(name, value); 068 return root; 069 } 070 071 /** 072 * Like - include '%' and '_' placeholders as necessary. 073 * 074 * @param value the equal to bind value 075 * @return the root query bean instance 076 */ 077 public R like(String value) { 078 expr().like(name, value); 079 return root; 080 } 081 082 /** 083 * Starts with - uses a like with '%' wildcard added to the end. 084 * 085 * @param value the equal to bind value 086 * @return the root query bean instance 087 */ 088 public R startsWith(String value) { 089 expr().startsWith(name, value); 090 return root; 091 } 092 093 /** 094 * Ends with - uses a like with '%' wildcard added to the beginning. 095 * 096 * @param value the equal to bind value 097 * @return the root query bean instance 098 */ 099 public R endsWith(String value) { 100 expr().endsWith(name, value); 101 return root; 102 } 103 104 /** 105 * Contains - uses a like with '%' wildcard added to the beginning and end. 106 * 107 * @param value the equal to bind value 108 * @return the root query bean instance 109 */ 110 public R contains(String value) { 111 expr().contains(name, value); 112 return root; 113 } 114 115 /** 116 * Case insensitive like. 117 * 118 * @param value the equal to bind value 119 * @return the root query bean instance 120 */ 121 public R ilike(String value) { 122 expr().ilike(name, value); 123 return root; 124 } 125 126 /** 127 * Case insensitive starts with. 128 * 129 * @param value the equal to bind value 130 * @return the root query bean instance 131 */ 132 public R istartsWith(String value) { 133 expr().istartsWith(name, value); 134 return root; 135 } 136 137 /** 138 * Case insensitive ends with. 139 * 140 * @param value the equal to bind value 141 * @return the root query bean instance 142 */ 143 public R iendsWith(String value) { 144 expr().iendsWith(name, value); 145 return root; 146 } 147 148 /** 149 * Case insensitive contains. 150 * 151 * @param value the equal to bind value 152 * @return the root query bean instance 153 */ 154 public R icontains(String value) { 155 expr().icontains(name, value); 156 return root; 157 } 158 159 /** 160 * Add a full text "Match" expression. 161 * <p> 162 * This means the query will automatically execute against the document store (ElasticSearch). 163 * </p> 164 * 165 * @param value the match expression 166 */ 167 public R match(String value) { 168 expr().match(name, value); 169 return root; 170 } 171}