All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unlaxer.tinyexpression.loader.model.FormulaInfoField Maven / Gradle / Ivy

There is a newer version: 1.4.4
Show newest version
package org.unlaxer.tinyexpression.loader.model;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Collection;
import java.util.function.Function;
import java.util.stream.Collectors;

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FormulaInfoField{
 
  Class> converter() default StringToString.class;
  
  public static class StringToString implements Function{

    @Override
    public String apply(Object t) {
      return (String)t;
    }
  }
  
  public static class StringsToString implements Function{

    @SuppressWarnings("unchecked")
    @Override
    public String apply(Object strings) {
      return ((Collection)strings).stream().collect(Collectors.joining(","));
    }
    
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy