Interface AltSvcConfig
- All Superinterfaces:
Prototype.Api, Prototype.Factory<AltSvc>
- All Known Implementing Classes:
AltSvcConfig.BuilderBase.AltSvcConfigImpl
Configuration of a single advertised alternative service.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forAltSvc.static classAltSvcConfig.BuilderBase<BUILDER extends AltSvcConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends AltSvcConfig>Fluent API builder base forAltSvcConfig. -
Method Summary
Modifier and TypeMethodDescriptionstatic AltSvcConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static AltSvcConfig.Builderbuilder(AltSvcConfig instance) Create a new fluent API builder from an existing instance.static AltSvcConfigcreate()Create a new instance with default values.static AltSvcConfigCreate a new instance from configuration.booleanenabled()Whether the alternative service should be advertised.maxAge()Advertised maximum age.booleanpersist()Whether to emit thepersist=1parameter.port()Advertised port.protocol()Advertised protocol name.Methods inherited from interface Prototype.Factory
build
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
-
enabled
boolean enabled()Whether the alternative service should be advertised.- Returns:
- whether advertisement is enabled
-
protocol
String protocol()Advertised protocol name. Each Java character in the rangeU+0000throughU+00FFmaps one-to-one to an opaque protocol identifier byte. When advertisement is enabled, the identifier must contain between1and255bytes, inclusive. Whitespace-only identifiers are valid.- Returns:
- advertised protocol
-
port
Advertised port. The port must be between1and65535, inclusive, when advertisement is enabled. If not configured, the local port of a port-capable binding is used. A binding without a valid port, such as a Unix domain socket binding, does not emit the configured advertisement unless an explicit port is configured.- Returns:
- advertised port
-
maxAge
-
persist
boolean persist()Whether to emit thepersist=1parameter.- Returns:
- whether to emit persist
-