@@ -1185,6 +1185,75 @@ public ExampleScript[] examples() throws ConfigCompileException {
11851185 }
11861186 }
11871187
1188+ @ api
1189+ public static class sequals_ic extends AbstractFunction implements Optimizable {
1190+
1191+ @ Override
1192+ public ExceptionType [] thrown () {
1193+ return null ;
1194+ }
1195+
1196+ @ Override
1197+ public boolean isRestricted () {
1198+ return false ;
1199+ }
1200+
1201+ @ Override
1202+ public Boolean runAsync () {
1203+ return null ;
1204+ }
1205+
1206+ @ Override
1207+ public Construct exec (Target t , Environment environment , Construct ... args ) throws ConfigRuntimeException {
1208+ Construct v1 = args [0 ];
1209+ Construct v2 = args [1 ];
1210+ if (!v2 .getClass ().equals (v1 .getClass ())){
1211+ return CBoolean .FALSE ;
1212+ }
1213+ return new equals_ic ().exec (t , environment , v1 , v2 );
1214+ }
1215+
1216+ @ Override
1217+ public String getName () {
1218+ return "sequals_ic" ;
1219+ }
1220+
1221+ @ Override
1222+ public Integer [] numArgs () {
1223+ return new Integer []{2 };
1224+ }
1225+
1226+ @ Override
1227+ public String docs () {
1228+ return "boolean {value1, value2} Returns true if the values are the same type, as well as equal, according to equals_ic."
1229+ + " Generally, equals_ic will suffice, because usually you will be comparing two strings, however, this function"
1230+ + " may be useful in various other cases, perhaps where the datatypes are unknown, but could be strings." ;
1231+ }
1232+
1233+ @ Override
1234+ public Version since () {
1235+ return CHVersion .V3_3_1 ;
1236+ }
1237+
1238+ @ Override
1239+ public Set <OptimizationOption > optimizationOptions () {
1240+ return EnumSet .of (
1241+ OptimizationOption .CONSTANT_OFFLINE ,
1242+ OptimizationOption .CACHE_RETURN
1243+ );
1244+ }
1245+
1246+ @ Override
1247+ public ExampleScript [] examples () throws ConfigCompileException {
1248+ return new ExampleScript []{
1249+ new ExampleScript ("Basic usage" , "sequals_ic(1, 1)" ),
1250+ new ExampleScript ("False result" , "sequals_ic('1', 1)" ),
1251+ new ExampleScript ("False result" , "sequals_ic('false', true)" )
1252+ };
1253+ }
1254+
1255+ }
1256+
11881257 @ api
11891258 @ seealso ({equals_ic .class })
11901259 public static class nequals_ic extends AbstractFunction implements Optimizable {
0 commit comments