All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jclouds.ovf.Envelope Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.jclouds.ovf;

import org.jclouds.ovf.internal.BaseEnvelope;

import com.google.common.collect.Multimap;

public class Envelope extends BaseEnvelope {

   @SuppressWarnings("unchecked")
   public static Builder builder() {
      return new Builder();
   }

   /**
    * {@inheritDoc}
    */
   @Override
   public Builder toBuilder() {
      return new Builder().fromEnvelope(this);
   }

   public static class Builder extends BaseEnvelope.Builder {

      /**
       * {@inheritDoc}
       */
      @Override
      public Envelope build() {
         return new Envelope(diskSections, networkSections, additionalSections, virtualSystem);
      }

      /**
       * {@inheritDoc}
       */
      @SuppressWarnings("unchecked")
      @Override
      public Builder additionalSection(String name, Section additionalSection) {
         return Builder.class.cast(super.additionalSection(name, additionalSection));
      }

      /**
       * {@inheritDoc}
       */
      @SuppressWarnings("unchecked")
      @Override
      public Builder additionalSections(Multimap additionalSections) {
         return Builder.class.cast(super.additionalSections(additionalSections));
      }

      /**
       * {@inheritDoc}
       */
      @Override
      public Builder diskSection(DiskSection diskSection) {
         return Builder.class.cast(super.diskSection(diskSection));
      }

      /**
       * {@inheritDoc}
       */
      @Override
      public Builder diskSections(Iterable diskSections) {
         return Builder.class.cast(super.diskSections(diskSections));
      }

      /**
       * {@inheritDoc}
       */
      @Override
      public Builder fromEnvelope(BaseEnvelope in) {
         return Builder.class.cast(super.fromEnvelope(in));
      }

      /**
       * {@inheritDoc}
       */
      @Override
      public Builder networkSection(NetworkSection networkSection) {
         return Builder.class.cast(super.networkSection(networkSection));
      }

      /**
       * {@inheritDoc}
       */
      @Override
      public Builder networkSections(Iterable networkSections) {
         return Builder.class.cast(super.networkSections(networkSections));
      }

      /**
       * {@inheritDoc}
       */
      @Override
      public Builder virtualSystem(VirtualSystem virtualSystem) {
         return Builder.class.cast(super.virtualSystem(virtualSystem));
      }

   }

   @SuppressWarnings("unchecked")
   public Envelope(Iterable diskSections, Iterable networkSections,
            Multimap additionalSections, VirtualSystem virtualSystem) {
      super(diskSections, networkSections, additionalSections, virtualSystem);
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy