Package de.innovationgate.wga.model

Source Code of de.innovationgate.wga.model.VersionCompliance

/*******************************************************************************
* Copyright 2009, 2010 Innovation Gate GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
/**
*
*/
package de.innovationgate.wga.model;


import de.innovationgate.wga.common.beans.csconfig.v1.CSConfig;
import de.innovationgate.wga.common.beans.csconfig.v1.Version;

public class VersionCompliance extends KeyValueBean<String, String> {
 
  public VersionCompliance(String key, String value) {
    super(key, value);
  }
 
  public static final String VERSIONCOMPLIANCE_WGA3 = CSConfig.VERSIONCOMPLIANCE_WGA3;
  public static final String VERSIONCOMPLIANCE_WGA4 = CSConfig.VERSIONCOMPLIANCE_WGA4;
  public static final String VERSIONCOMPLIANCE_WGA41 = CSConfig.VERSIONCOMPLIANCE_WGA41;
  public static final String VERSIONCOMPLIANCE_WGA50 = CSConfig.VERSIONCOMPLIANCE_WGA50;
  public static final String VERSIONCOMPLIANCE_WGA51 = CSConfig.VERSIONCOMPLIANCE_WGA51;
  public static final String VERSIONCOMPLIANCE_WGA52 = CSConfig.VERSIONCOMPLIANCE_WGA52;
  public static final String VERSIONCOMPLIANCE_WGA53 = CSConfig.VERSIONCOMPLIANCE_WGA53;
  public static final String VERSIONCOMPLIANCE_WGA54 = CSConfig.VERSIONCOMPLIANCE_WGA54;
  public Version toWGAVersion() {
    return toWGAVersion(this);
  }
 
  public static Version toWGAVersion(VersionCompliance versionCompliance) {
    if (versionCompliance != null) {
      if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA3)) {
        return new Version(3, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA4)) {
        return new Version(4, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA41)) {
        return new Version(4, 1, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA50)) {
        return new Version(5, 0 ,0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA51)) {
                return new Version(5, 1 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA52)) {
                return new Version(5, 2 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA53)) {
                return new Version(5, 3 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA54)) {
                return new Version(5, 4 ,0);
            }
    }
    return null;
  }
}
TOP

Related Classes of de.innovationgate.wga.model.VersionCompliance

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.