001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
002 *
003 * Copyright © 2017 MicroBean.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
014 * implied.  See the License for the specific language governing
015 * permissions and limitations under the License.
016 */
017package org.microbean.helm.maven;
018
019import java.io.Serializable; // for javadoc only
020
021import java.util.EventObject; // for javadoc only
022import java.util.Objects;
023
024import hapi.services.tiller.Tiller.GetReleaseContentResponseOrBuilder;
025
026/**
027 * An {@link AbstractReleaseEvent} describing a retrieval of the
028 * content of a <a href="https://docs.helm.sh/glossary/#release">Helm
029 * release</a>.
030 *
031 * @author <a href="https://about.me/lairdnelson"
032 * target="_parent">Laird Nelson</a>
033 *
034 * @see ReleaseContentListener
035 *
036 * @see GetReleaseContentMojo
037 */
038public class ReleaseContentEvent extends AbstractReleaseEvent {
039
040  
041  /*
042   * Static fields.
043   */
044
045
046  /**
047   * The version of this class for {@linkplain Serializable
048   * serialization} purposes.
049   */
050  private static final long serialVersionUID = 1L;
051    
052
053  /*
054   * Instance fields.
055   */
056
057
058  /**
059   * The {@link
060   * hapi.services.tiller.Tiller.GetReleaseContentResponseOrBuilder}
061   * describing the release content retrieval.
062   *
063   * <p>This field will never be {@code null}.</p>
064   *
065   * @see #ReleaseContentEvent(GetReleaseContentMojo,
066   * hapi.services.tiller.Tiller.GetReleaseContentResponseOrBuilder)
067   */
068  private final GetReleaseContentResponseOrBuilder getReleaseContentResponseOrBuilder;
069  
070  public ReleaseContentEvent(final GetReleaseContentMojo source, final GetReleaseContentResponseOrBuilder getReleaseContentResponseOrBuilder) {
071    super(source);
072    Objects.requireNonNull(getReleaseContentResponseOrBuilder);
073    this.getReleaseContentResponseOrBuilder = getReleaseContentResponseOrBuilder;
074  }
075
076  
077  /*
078   * Instance methods.
079   */
080
081
082  /**
083   * Returns the {@link
084   * hapi.services.tiller.Tiller.GetReleaseContentResponseOrBuilder}
085   * implementation representing the release content retrieval.
086   *
087   * <p>This method never returns {@code null}.</p>
088   *
089   * @return the {@link
090   * hapi.services.tiller.Tiller.GetReleaseContentResponseOrBuilder}
091   * implementation representing the release content retrieval; never
092   * {@code null}
093   */
094  public final GetReleaseContentResponseOrBuilder getReleaseContentResponseOrBuilder() {
095    return this.getReleaseContentResponseOrBuilder;
096  }
097
098  /**
099   * Returns the {@link GetReleaseContentMojo} responsible for firing
100   * this event.
101   *
102   * <p>This method never returns {@code null}.</p>
103   *
104   * @return the {@link GetReleaseContentMojo} responsible for firing
105   * this event; never {@code null}
106   */
107  @Override
108  public final GetReleaseContentMojo getSource() {
109    return (GetReleaseContentMojo)super.getSource();
110  }
111  
112}