Package org.onosproject.core
Class DefaultApplication.Builder
- java.lang.Object
-
- org.onosproject.core.DefaultApplication.Builder
-
- Enclosing class:
- DefaultApplication
public static final class DefaultApplication.Builder extends java.lang.Object
Default application builder.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Default constructor for the builder.Builder(ApplicationDescription appDesc)
Updates the builder to be a copy of an existing application description.Builder(Application application)
Updates the builder to be a copy of an existing application.Builder(DefaultApplication.Builder builder)
Updates the builder to be a copy of an existing builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultApplication
build()
Builds a default application object from the gathered parameters.DefaultApplication.Builder
withAppId(ApplicationId appId)
Adds an application id.DefaultApplication.Builder
withCategory(java.lang.String category)
Adds a category string.DefaultApplication.Builder
withDescription(java.lang.String description)
Adds a description string.DefaultApplication.Builder
withFeatures(java.util.List<java.lang.String> features)
Adds a features list.DefaultApplication.Builder
withFeaturesRepo(java.util.Optional<java.net.URI> featuresRepo)
Adds a URI for a features repository.DefaultApplication.Builder
withIcon(byte[] icon)
Adds an icon.DefaultApplication.Builder
withImageUrl(java.net.URL imageUrl)
Adds a Binary Image URL.DefaultApplication.Builder
withOrigin(java.lang.String origin)
Adds an origin string.DefaultApplication.Builder
withPermissions(java.util.Set<Permission> permissions)
Adds a permissions set.DefaultApplication.Builder
withReadme(java.lang.String readme)
Adds a readme string.DefaultApplication.Builder
withRequiredApps(java.util.List<java.lang.String> requiredApps)
Adds a list of required applications.DefaultApplication.Builder
withRole(ApplicationRole role)
Adds an application role.DefaultApplication.Builder
withTitle(java.lang.String title)
Adds a title string.DefaultApplication.Builder
withUrl(java.lang.String url)
Adds a URL string.DefaultApplication.Builder
withVersion(Version version)
Adds a version string.
-
-
-
Constructor Detail
-
Builder
public Builder()
Default constructor for the builder.
-
Builder
public Builder(DefaultApplication.Builder builder)
Updates the builder to be a copy of an existing builder.- Parameters:
builder
- existing builder to copy
-
Builder
public Builder(Application application)
Updates the builder to be a copy of an existing application.- Parameters:
application
- existing application to copy
-
Builder
public Builder(ApplicationDescription appDesc)
Updates the builder to be a copy of an existing application description.- Parameters:
appDesc
- existing application description
-
-
Method Detail
-
withAppId
public DefaultApplication.Builder withAppId(ApplicationId appId)
Adds an application id.- Parameters:
appId
- application id- Returns:
- builder
-
withVersion
public DefaultApplication.Builder withVersion(Version version)
Adds a version string.- Parameters:
version
- version string- Returns:
- builder
-
withTitle
public DefaultApplication.Builder withTitle(java.lang.String title)
Adds a title string.- Parameters:
title
- title string- Returns:
- builder
-
withDescription
public DefaultApplication.Builder withDescription(java.lang.String description)
Adds a description string.- Parameters:
description
- description string- Returns:
- builder
-
withCategory
public DefaultApplication.Builder withCategory(java.lang.String category)
Adds a category string.- Parameters:
category
- category string- Returns:
- builder
-
withUrl
public DefaultApplication.Builder withUrl(java.lang.String url)
Adds a URL string.- Parameters:
url
- url string- Returns:
- builder
-
withReadme
public DefaultApplication.Builder withReadme(java.lang.String readme)
Adds a readme string.- Parameters:
readme
- readme string- Returns:
- builder
-
withIcon
public DefaultApplication.Builder withIcon(byte[] icon)
Adds an icon.- Parameters:
icon
- icon data- Returns:
- builder
-
withOrigin
public DefaultApplication.Builder withOrigin(java.lang.String origin)
Adds an origin string.- Parameters:
origin
- origin string- Returns:
- builder
-
withRole
public DefaultApplication.Builder withRole(ApplicationRole role)
Adds an application role.- Parameters:
role
- application role- Returns:
- builder
-
withPermissions
public DefaultApplication.Builder withPermissions(java.util.Set<Permission> permissions)
Adds a permissions set.- Parameters:
permissions
- permissions set- Returns:
- builder
-
withFeaturesRepo
public DefaultApplication.Builder withFeaturesRepo(java.util.Optional<java.net.URI> featuresRepo)
Adds a URI for a features repository.- Parameters:
featuresRepo
- Optional URI for a features repository- Returns:
- builder
-
withFeatures
public DefaultApplication.Builder withFeatures(java.util.List<java.lang.String> features)
Adds a features list.- Parameters:
features
- features list- Returns:
- builder
-
withRequiredApps
public DefaultApplication.Builder withRequiredApps(java.util.List<java.lang.String> requiredApps)
Adds a list of required applications.- Parameters:
requiredApps
- List of name strings of required applications- Returns:
- builder
-
withImageUrl
public DefaultApplication.Builder withImageUrl(java.net.URL imageUrl)
Adds a Binary Image URL.- Parameters:
imageUrl
- url of oar file- Returns:
- builder
-
build
public DefaultApplication build()
Builds a default application object from the gathered parameters.- Returns:
- new default application
-
-