Class AbstractFunction<T>

java.lang.Object
org.graylog.plugins.pipelineprocessor.ast.functions.AbstractFunction<T>
Type Parameters:
T - the return type
All Implemented Interfaces:
Function<T>
Direct Known Subclasses:
Abbreviate, AbstractPeriodComponentFunction, Base16Decode, Base16Encode, Base32Decode, Base32Encode, Base32HumanDecode, Base32HumanEncode, Base64Decode, Base64Encode, Base64UrlDecode, Base64UrlEncode, BooleanConversion, CEFParserFunction, CidrMatch, CloneMessage, Concat, Contains, CRC32, CRC32C, CreateMessage, Debug, DoubleConversion, DropMessage, EndsWith, FirstNonNull, FormatDate, FromInput, GlobalDomainLookupFunction, GlobalIpLookupFunction, GrokExists, GrokMatch, HasField, IpAddressConversion, IsBoolean, IsCollection, IsDate, IsDouble, IsIp, IsJson, IsList, IsLong, IsMap, IsNotNull, IsNull, IsNumber, IsPeriod, IsString, IsUrl, Join, JsonFlatten, JsonParse, KeyValue, Length, LongConversion, Lookup, LookupAddStringList, LookupAssignTtl, LookupClearKey, LookupHasValue, LookupRemoveStringList, LookupSetStringList, LookupSetValue, LookupStringList, LookupStringListContains, LookupTableFunction, LookupValue, MapConversion, MD5, MetricCounterIncrement, Murmur3_128, Murmur3_32, NormalizeFields, PeriodParseFunction, PrivateNetLookupFunction, RegexMatch, RegexReplace, RemoveField, RemoveFromStream, RenameField, Replace, RouteToStream, SelectJsonPath, SetField, SetFields, SHA1, SHA256, SHA512, Split, StartsWith, StringConversion, StringEntropy, StringUtilsFunction, Substring, SyslogFacilityConversion, SyslogLevelConversion, SyslogPriorityConversion, SyslogPriorityToStringConversion, TimezoneAwareFunction, TrafficAccountingSize, UrlConversion, UrlDecode, UrlEncode

public abstract class AbstractFunction<T> extends Object implements Function<T>
Helper Function implementation which evaluates and memoizes all constant FunctionArgs.
  • Constructor Details

    • AbstractFunction

      public AbstractFunction()
  • Method Details

    • preComputeConstantArgument

      public Object preComputeConstantArgument(FunctionArgs args, String name, Expression arg)
      Description copied from interface: Function
      Implementations should provide a non-null value for each argument they wish to pre-compute.
      Examples include compile a Pattern from a regex string, which will never change during the lifetime of the function. If any part of the expression tree depends on external values this method will not be called, e.g. if the regex depends on a message field.
      Specified by:
      preComputeConstantArgument in interface Function<T>
      Parameters:
      args - the function args for this functions, usually you don't need this
      name - the name of the argument to potentially precompute
      arg - the expression tree for the argument
      Returns:
      the precomputed value for the argument or null if the value should be dynamically calculated for each invocation