org.yangcentral.yangkit.model.impl.stmt.RevisionDateImpl Maven / Gradle / Ivy
package org.yangcentral.yangkit.model.impl.stmt;
import org.yangcentral.yangkit.base.ErrorCode;
import org.yangcentral.yangkit.base.YangBuiltinKeyword;
import org.yangcentral.yangkit.common.api.QName;
import org.yangcentral.yangkit.common.api.validate.ValidatorResult;
import org.yangcentral.yangkit.common.api.validate.ValidatorResultBuilder;
import org.yangcentral.yangkit.model.api.stmt.RevisionDate;
import org.yangcentral.yangkit.util.ModelUtil;
public class RevisionDateImpl extends YangSimpleStatementImpl implements RevisionDate {
public RevisionDateImpl(String argStr) {
super(argStr);
}
public QName getYangKeyword() {
return YangBuiltinKeyword.REVISIONDATE.getQName();
}
protected ValidatorResult initSelf() {
ValidatorResultBuilder validatorResultBuilder = new ValidatorResultBuilder();
validatorResultBuilder.merge(super.initSelf());
if (!ModelUtil.isYYYY_MM_DD(this.getArgStr())) {
validatorResultBuilder.addRecord(ModelUtil.reportError(this,
ErrorCode.INVALID_REVISION_FORMAT.getFieldName()));
}
return validatorResultBuilder.build();
}
}