/* * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.model.repo.api; import com.google.common.annotations.Beta; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import java.util.Objects; /** * YANG Schema revision source identifier * * Simple transfer object represents revision identifier of source for YANG * schema (module or submodule), which consists of *
* (For further reference see: http://tools.ietf.org/html/rfc6020#section-5.2
* and http://tools.ietf.org/html/rfc6022#section-3.1 ).
*/
@Beta
public final class RevisionSourceIdentifier extends SourceIdentifier {
private static final long serialVersionUID = 1L;
/**
*
* Creates new YANG Schema revision source identifier for sources without
* revision. {@link SourceIdentifier#NOT_PRESENT_FORMATTED_REVISION} as
* default revision.
*
* @param name
* Name of schema
*/
RevisionSourceIdentifier(final String name) {
this(name, NOT_PRESENT_FORMATTED_REVISION);
}
/**
* Creates new YANG Schema revision source identifier.
*
* @param name
* Name of schema
* @param formattedRevision
* Revision of source in format YYYY-mm-dd
*/
RevisionSourceIdentifier(final String name, final String formattedRevision) {
super(Preconditions.checkNotNull(name), Preconditions.checkNotNull(formattedRevision));
}
/**
*
* Creates new YANG Schema revision source identifier.
*
* @param name
* Name of schema
* @param formattedRevision
* Revision of source in format YYYY-mm-dd. If not present,
* default value will be used.
*/
RevisionSourceIdentifier(final String name, final Optional