/** * Construct a ProfileBuilder. */ public ProfileBuilder build() { if(definition == null) { throw new IllegalArgumentException("missing profiler definition; got null"); } if(StringUtils.isEmpty(entity)) { throw new IllegalArgumentException(format("missing entity name; got '%s'", entity)); } if(periodDurationMillis == null) { throw new IllegalArgumentException("missing period duration"); } return new DefaultProfileBuilder(definition, entity, periodDurationMillis, context); } }