generate MetricConstraint Class