/*
 * Copyright 2015 52°North Initiative for Geospatial Open Source
 * Software 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 org.n52.iceland.ogc.ows;

import org.n52.iceland.util.StringHelper;

/**
 * @since 1.0.0
 * 
 */
public abstract class OwsCapabilities {

    private String service;

    private String version;

    private String updateSequence;

    /**
     * Service identification, loaded from file.
     */
    private OwsServiceIdentification serviceIdentification;

    /**
     * Service provider, loaded from file.
     */
    private OwsServiceProvider serviceProvider;

    /**
     * Operations meta data for all supported operations.
     */
    private OwsOperationsMetadata operationsMetadata;

    public OwsCapabilities(String service, String version) {
        this.version = version;
    }
    
    /**
     * @param service the service
     */
    public void setService(String service) {
    	this.service = service;
    }

    /**
     * @return the service
     */
    public String getService() {
        return this.service;
    }

    /**
     * @return the version
     */
    public String getVersion() {
        return version;
    }

    /**
     * @param version
     *            the version to set
     */
    public void setVersion(String version) {
        this.version = version;
    }

    public boolean isSetVersion() {
        return StringHelper.isNotEmpty(getVersion());
    }

    /**
     * @return the updateSequence
     */
    public String getUpdateSequence() {
        return updateSequence;
    }

    /**
     * @param updateSequence
     *            the updateSequence to set
     */
    public void setUpdateSequence(String updateSequence) {
        this.updateSequence = updateSequence;
    }

    public boolean isSetUpdateSequence() {
        return StringHelper.isNotEmpty(getUpdateSequence());
    }

    /**
     * Set service identification
     * 
     * @param serviceIdentification
     *            service identification
     */
    public void setServiceIdentification(OwsServiceIdentification serviceIdentification) {
        this.serviceIdentification = serviceIdentification;

    }

    /**
     * Get service identification
     * 
     * @return service identification
     */
    public OwsServiceIdentification getServiceIdentification() {
        return serviceIdentification;
    }

    public boolean isSetServiceIdentification() {
        return getServiceIdentification() != null;
    }

    /**
     * Set service provider
     * 
     * @param serviceProvider
     *            service provider
     */
    public void setServiceProvider(OwsServiceProvider serviceProvider) {
        this.serviceProvider = serviceProvider;

    }

    /**
     * Get service provider
     * 
     * @return service provider
     */
    public OwsServiceProvider getServiceProvider() {
        return serviceProvider;
    }

    public boolean isSetServiceProvider() {
        return getServiceProvider() != null;
    }

    /**
     * Get operations metadata
     * 
     * @return operations metadata
     */
    public OwsOperationsMetadata getOperationsMetadata() {
        return operationsMetadata;
    }

    /**
     * Set operations metadata
     * 
     * @param operationsMetadata
     *            operations metadata
     */
    public void setOperationsMetadata(OwsOperationsMetadata operationsMetadata) {
        this.operationsMetadata = operationsMetadata;
    }

    public boolean isSetOperationsMetadata() {
        return getOperationsMetadata() != null && !getOperationsMetadata().isEmpty();
    }
}

@@ -755,17 +755,8 @@
 lic 
-abstract 
 clas
@@ -775,16 +775,16 @@
 ities %7B%0A
+
 %0A    pri
@@ -1232,17 +1232,413 @@
 tadata;%0A
+    %0A    %0A    public OwsCapabilities() %7B%0A    %7D%0A    %0A    public OwsCapabilities(OwsCapabilities owsCapabilities) %7B%0A        copyToThis(owsCapabilities);%0A    %7D%0A    %0A    public OwsCapabilities(String service, OwsCapabilities owsCapabilities) %7B%0A       this(owsCapabilities);%0A       setService(service);%0A    %7D%0A    %0A    public OwsCapabilities(String version) %7B%0A        this.version = version;%0A    %7D%0A    
 %0A
-
     publ
@@ -1718,32 +1718,64 @@
  = version;%0A
+        this.service = service;%0A
     %7D%0A  
   %0A    /**%0A 
@@ -1758,26 +1758,25 @@
 ce;%0A    %7D%0A  
-  
+%0A
 %0A    /**%0A   
@@ -1967,24 +1967,24 @@
 Service() %7B%0A
-
         retu
@@ -1997,32 +1997,133 @@
 s.service;%0A    %7D
+%0A    %0A    public boolean isSetService() %7B%0A        return StringHelper.isNotEmpty(getService());%0A    %7D
 %0A%0A    /**%0A     *
@@ -4636,10 +4636,864 @@
 ;%0A    %7D%0A
+    %0A    private void copyToThis(OwsCapabilities owsCapabilities) %7B%0A        if (owsCapabilities.isSetService()) %7B%0A            setService(owsCapabilities.getService());%0A        %7D%0A        if (owsCapabilities.isSetVersion()) %7B%0A            setVersion(owsCapabilities.getVersion());%0A        %7D%0A        if (owsCapabilities.isSetUpdateSequence()) %7B%0A            setUpdateSequence(owsCapabilities.getUpdateSequence());%0A        %7D%0A        if (owsCapabilities.isSetServiceIdentification()) %7B%0A            setServiceIdentification(owsCapabilities.getServiceIdentification());%0A        %7D%0A        if (owsCapabilities.isSetServiceProvider()) %7B%0A            setServiceProvider(owsCapabilities.getServiceProvider());%0A        %7D%0A        if (owsCapabilities.isSetOperationsMetadata()) %7B%0A            setOperationsMetadata(owsCapabilities.getOperationsMetadata());%0A        %7D%0A    %7D%0A
 %7D%0A

Remove abstract keyword from class