class FeatureSetValidator {

  public static void validateSpec(FeatureSet featureSet) {
    if (featureSet.getSpec().getProject().isEmpty()) {
      throw new IllegalArgumentException("Project name must be provided");
    }
    if (featureSet.getSpec().getName().isEmpty()) {
      throw new IllegalArgumentException("Feature set name must be provided");
    }
    if (featureSet.getSpec().getLabelsMap().containsKey("")) {
      throw new IllegalArgumentException("Feature set label keys must not be empty");
    }

    checkValidCharacters(featureSet.getSpec().getProject(), "project");
    checkValidCharacters(featureSet.getSpec().getName(), "featureset");
    checkUniqueColumns(
        featureSet.getSpec().getEntitiesList(), featureSet.getSpec().getFeaturesList());
    checkReservedColumns(featureSet.getSpec().getFeaturesList());
    for (EntitySpec entitySpec : featureSet.getSpec().getEntitiesList()) {
      checkValidCharacters(entitySpec.getName(), "entity");
    }
    for (FeatureSpec featureSpec : featureSet.getSpec().getFeaturesList()) {
      checkValidCharacters(featureSpec.getName(), "feature");
      if (featureSpec.getLabelsMap().containsKey("")) {
        throw new IllegalArgumentException("Feature label keys must not be empty");
      }
    }
  }

}