net.thisptr.java.prometheus.metrics.agent.jackson.serdes.AttributeNamePatternDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-prometheus-metrics-agent Show documentation
Show all versions of java-prometheus-metrics-agent Show documentation
Java agent for collecting and reporting metrics to Prometheus
package net.thisptr.java.prometheus.metrics.agent.jackson.serdes;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import net.thisptr.java.prometheus.metrics.agent.misc.AttributeNamePattern;
public class AttributeNamePatternDeserializer extends StdDeserializer {
private static final long serialVersionUID = 503000533123157062L;
public AttributeNamePatternDeserializer() {
super(AttributeNamePattern.class);
}
@Override
public AttributeNamePattern deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
final String patternText = p.readValueAs(String.class);
if (patternText == null)
return null;
return AttributeNamePattern.compile(patternText);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy