/** * Builder a new {@link MetricContext}. * * <p> * See {@link Taggable#metricNamePrefix(boolean)} for the semantic of {@code includeTagKeys}. * </p> * * @return the newly built {@link MetricContext} * @throws NameConflictException if the parent {@link MetricContext} already has a child with this name. */ public MetricContext buildStrict() throws NameConflictException { if(this.parent == null) { hasParent(RootMetricContext.get()); } return new MetricContext(this.name, this.parent, this.tags, false); }
/** * Builder a new {@link MetricContext}. * * <p> * See {@link Taggable#metricNamePrefix(boolean)} for the semantic of {@code includeTagKeys}. * </p> * * @return the newly built {@link MetricContext} * @throws NameConflictException if the parent {@link MetricContext} already has a child with this name. */ public MetricContext buildStrict() throws NameConflictException { if(this.parent == null) { hasParent(RootMetricContext.get()); } return new MetricContext(this.name, this.parent, this.tags, false); }