类 StreamOrientedChartLoader<T>
- java.lang.Object
-
- org.microbean.helm.chart.AbstractChartLoader<T>
-
- org.microbean.helm.chart.StreamOrientedChartLoader<T>
-
- 类型参数:
T- the type of source from which thisStreamOrientedChartLoaderis capable of loading Helm charts
- 所有已实现的接口:
Closeable,AutoCloseable
public abstract class StreamOrientedChartLoader<T> extends AbstractChartLoader<T>
A partialAbstractChartLoaderimplementation that is capable of loading a Helm-compatible chart from any source that is convertible into anIterableofInputStreams indexed by their name.
-
-
构造器概要
构造器 限定符 构造器 说明 protectedStreamOrientedChartLoader()Creates a newStreamOrientedChartLoader.
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected TemplateOuterClass.Template.BuildercreateTemplateBuilder(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream, String name)protected voidinstallAny(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream, String name)Installs anAnyobject, representing an arbitrary chart file with the suppliednameand represented by the suppliedInputStream, into the suppliedChart.Builder.protected voidinstallConfig(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream)Installs aConfigOuterClass.Configobject, represented by the suppliedInputStream, into the suppliedChart.Builder.protected voidinstallMetadata(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream)Installs aMetadataOuterClass.Metadataobject, represented by the suppliedInputStream, into the suppliedChart.Builder.ChartOuterClass.Chart.Builderload(ChartOuterClass.Chart.Builder parent, Iterable<? extends Map.Entry<? extends String,? extends InputStream>> entrySet, String valueFileName)Creates a newChartOuterClass.Chartfrom the supplied notional set of namedInputStreams and returns it.ChartOuterClass.Chart.Builderload(ChartOuterClass.Chart.Builder parent, T source, String valueFileName)Creates a newChartOuterClass.Chartfrom the suppliedsourcein some manner and returns it.protected abstract Iterable<? extends Map.Entry<? extends String,? extends InputStream>>toNamedInputStreamEntries(T source)Converts the suppliedsourceinto anIterableofMap.Entryinstances whose keys are names and whose values are correspondingInputStreams.-
从类继承的方法 org.microbean.helm.chart.AbstractChartLoader
load, load
-
-
-
-
构造器详细资料
-
StreamOrientedChartLoader
protected StreamOrientedChartLoader()
Creates a newStreamOrientedChartLoader.
-
-
方法详细资料
-
toNamedInputStreamEntries
protected abstract Iterable<? extends Map.Entry<? extends String,? extends InputStream>> toNamedInputStreamEntries(T source) throws IOException
Converts the suppliedsourceinto anIterableofMap.Entryinstances whose keys are names and whose values are correspondingInputStreams.Implementations of this method must not return
null.The
IterableofMap.Entryinstances returned by implementations of this method must produce anIteratorthat will never returnnullfrom any invocation of itsIterator.next()method when, on the same thread, the return value of an invocation of itsIterator.hasNext()method has previously returnedtrue.Map.Entryinstances returned byIteratorinstances produced by theIterablereturned by this method must never returnnullfrom theirMap.Entry.getKey()method. They are permitted to returnnullfrom theirMap.Entry.getValue()method, and this feature can be used, for example, to indicate that a particular entry is a directory.- 参数:
source- the source to convert; must not benull- 返回:
- an
Iterableof suitableMap.Entryinstances; nevernull - 抛出:
NullPointerException- ifsourceisnullIOException- if an error occurs while converting
-
load
public ChartOuterClass.Chart.Builder load(ChartOuterClass.Chart.Builder parent, T source, String valueFileName) throws IOException
Creates a newChartOuterClass.Chartfrom the suppliedsourcein some manner and returns it.This method never returns
null.- 指定者:
load在类中AbstractChartLoader<T>- 参数:
source- the source object from which to load a newChartOuterClass.Chart; must not benullvalueFileName- the value filenameparent- theChartOuterClass.Chart.Builderthat will serve as the parent of theChartOuterClass.Chart.Builderthat will be returned; may be (and often is)null, indicating that theChartOuterClass.Chart.Builderbeing returned does not represent a subchart; must not be what is returned- 返回:
- a new
ChartOuterClass.Chart; nevernull - 抛出:
NullPointerException- ifsourceisnullIllegalStateExceptionIOException- if a problem is encountered while creating theChartOuterClass.Chartto return- 另请参阅:
toNamedInputStreamEntries(Object)
-
load
public ChartOuterClass.Chart.Builder load(ChartOuterClass.Chart.Builder parent, Iterable<? extends Map.Entry<? extends String,? extends InputStream>> entrySet, String valueFileName) throws IOException
Creates a newChartOuterClass.Chartfrom the supplied notional set of namedInputStreams and returns it.This method never returns
null.This method is called by the
AbstractChartLoader.load(Object)method.- 参数:
entrySet- theIterableofMap.Entryinstances normally returned by thetoNamedInputStreamEntries(Object)method; must not benull- 返回:
- a new
ChartOuterClass.Chart; nevernull - 抛出:
NullPointerException- ifentrySetisnullIOException- if a problem is encountered while creating theChartOuterClass.Chartto return- 另请参阅:
toNamedInputStreamEntries(Object),AbstractChartLoader.load(Object)
-
installConfig
protected void installConfig(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream) throws IOException
Installs aConfigOuterClass.Configobject, represented by the suppliedInputStream, into the suppliedChart.Builder.- 参数:
chartBuilder- theChart.Builderto affect; must not benullstream- anInputStreamrepresenting valid values file contents as defined by the chart specification; must not benull- 抛出:
NullPointerException- ifchartBuilderorstreamisnullIOException- if there was a problem reading from the suppliedInputStream- 另请参阅:
ChartOuterClass.Chart.Builder.getValuesBuilder(),ConfigOuterClass.Config.Builder.setRawBytes(ByteString)
-
installMetadata
protected void installMetadata(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream) throws IOException
Installs aMetadataOuterClass.Metadataobject, represented by the suppliedInputStream, into the suppliedChart.Builder.- 参数:
chartBuilder- theChart.Builderto affect; must not benullstream- anInputStreamrepresenting validChart.yamlcontents as defined by the chart specification; must not benull- 抛出:
NullPointerException- ifchartBuilderorstreamisnullIOException- if there was a problem reading from the suppliedInputStream- 另请参阅:
ChartOuterClass.Chart.Builder.getMetadataBuilder(),MetadataOuterClass.Metadata.Builder
-
createTemplateBuilder
protected TemplateOuterClass.Template.Builder createTemplateBuilder(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream, String name) throws IOException
Creates a newTemplateOuterClass.Template.Builderfrom the contents of the suppliedInputStream, with the suppliedname, and returns it.This method never returns
null.- 参数:
chartBuilder- aChartOuterClass.Chart.BuilderwhoseChartOuterClass.Chart.Builder.addTemplatesBuilder()method will be called to create the newTemplateOuterClass.Template.Builderinstance; must not benullstream- anInputStreamcontaining valid template contents as defined by the chart specification; must not benullname- the name for the newTemplateOuterClass.Templatethat will ultimately reside within the chart; must not benull- 返回:
- a new
TemplateOuterClass.Template.Builder; nevernull - 抛出:
NullPointerException- ifchartBuilder,streamornameisnullIOException- if there was a problem reading from the suppliedInputStream- 另请参阅:
TemplateOuterClass.Template.Builder
-
installAny
protected void installAny(ChartOuterClass.Chart.Builder chartBuilder, InputStream stream, String name) throws IOException
Installs anAnyobject, representing an arbitrary chart file with the suppliednameand represented by the suppliedInputStream, into the suppliedChart.Builder.- 参数:
chartBuilder- theChart.Builderto affect; must not benullstream- anInputStreamrepresenting valid chart file contents as defined by the chart specification; must not benullname- the name of the file within the chart; must not benull- 抛出:
NullPointerException- ifchartBuilderorstreamornameisnullIOException- if there was a problem reading from the suppliedInputStream- 另请参阅:
ChartOuterClass.Chart.Builder.addFilesBuilder()
-
-