Class AbstractHttpRegistryRestServerDecorator<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>

java.lang.Object
org.refcodes.rest.AbstractHttpRestServerDecorator<B>
org.refcodes.rest.AbstractHttpRegistryRestServerDecorator<DESC,B>
All Implemented Interfaces:
org.refcodes.component.Closable, org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<org.refcodes.web.HttpServerContext,HttpRestServer>>, org.refcodes.component.Configurable<HttpRegistryContext<DESC>>, org.refcodes.component.ConnectionComponent<org.refcodes.web.HttpServerContext>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<org.refcodes.web.HttpServerContext,HttpRestServer>, org.refcodes.component.ConnectionOpenable<org.refcodes.web.HttpServerContext>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<org.refcodes.web.HttpServerContext,org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<org.refcodes.web.HttpServerContext,HttpRestServer>>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.Destroyable, org.refcodes.component.Destroyable.DestroyAutomaton, org.refcodes.component.Initializable, org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.InitializedAccessor, org.refcodes.component.LifecycleComponent, org.refcodes.component.LifecycleComponent.LifecycleAutomaton, org.refcodes.component.LifecycleStatusAccessor, org.refcodes.component.LinkComponent, org.refcodes.component.Openable, org.refcodes.component.OpenedAccessor, org.refcodes.component.Pausable, org.refcodes.component.Pausable.PauseAutomaton, org.refcodes.component.Resumable, org.refcodes.component.Resumable.ResumeAutomaton, org.refcodes.component.RunningAccessor, org.refcodes.component.Startable, org.refcodes.component.Startable.StartAutomaton, org.refcodes.component.Stoppable, org.refcodes.component.Stoppable.StopAutomaton, org.refcodes.io.MaxConnectionsAccessor, org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsBuilder<HttpRestServer>, org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsMutator, org.refcodes.io.MaxConnectionsAccessor.MaxConnectionsProperty, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.AliasAccessor.AliasBuilder<B>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty, org.refcodes.mixin.InstanceIdAccessor, org.refcodes.mixin.InstanceIdAccessor.InstanceIdBuilder<B>, org.refcodes.mixin.InstanceIdAccessor.InstanceIdMutator, org.refcodes.mixin.InstanceIdAccessor.InstanceIdProperty, org.refcodes.mixin.PortAccessor, org.refcodes.mixin.PortAccessor.PortBuilder<HttpRestServer>, org.refcodes.mixin.PortAccessor.PortMutator, org.refcodes.mixin.PortAccessor.PortProperty, org.refcodes.net.IpAddressAccessor, org.refcodes.net.IpAddressAccessor.IpAddressBuilder<B>, org.refcodes.net.IpAddressAccessor.IpAddressMutator, org.refcodes.net.IpAddressAccessor.IpAddressProperty, org.refcodes.observer.Observable<RestEndpoint>, org.refcodes.observer.Observers<RestEndpoint,RestServer>, HttpExceptionHandlerAccessor, HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>, HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator, HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty, HttpExceptionHandlingAccessor, HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>, HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator, HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty, HttpRegistry<DESC,B>, HttpRegistryRestServer<DESC,B>, HttpRegistryUrlAccessor, HttpRegistryUrlAccessor.HttpRegistryUrlBuilder<B>, HttpRegistryUrlAccessor.HttpRegistryUrlMutator, HttpRegistryUrlAccessor.HttpRegistryUrlProperty, HttpRestServer, HttpServerDescriptorAccessor<DESC>, HttpServerDescriptorAccessor.HttpServerDescriptorBuilder<DESC,B>, HttpServerDescriptorAccessor.HttpServerDescriptorMutator<DESC>, HttpServerDescriptorAccessor.HttpServerDescriptorProperty<DESC>, HttpServerDescriptorFactory<DESC>, PingPathAccessor, PingPathAccessor.PingPathBuilder<B>, PingPathAccessor.PingPathMutator, PingPathAccessor.PingPathProperty, PingRequestObserver, PingRequestObserverAccessor, PingRequestObserverAccessor.PingRequestObserverBuilder<B>, RestServer, org.refcodes.runtime.RequestCorrelation<RestServer>, org.refcodes.runtime.SessionCorrelation<RestServer>, org.refcodes.security.KeyStoreDescriptorAccessor, org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorBuilder<HttpRestServer>, org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorMutator, org.refcodes.security.KeyStoreDescriptorAccessor.KeyStoreDescriptorProperty, org.refcodes.security.TrustStoreDescriptorAccessor, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, org.refcodes.web.BaseLocatorAccessor, org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>, org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty, org.refcodes.web.BasicAuthObservable<HttpRestServer>, org.refcodes.web.HostAccessor, org.refcodes.web.HostAccessor.HostBuilder<B>, org.refcodes.web.HostAccessor.HostMutator, org.refcodes.web.HostAccessor.HostProperty, org.refcodes.web.HttpsConnectionRequestObservable<HttpRestServer>, org.refcodes.web.MediaTypeFactoryLookup, org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.web.RealmAccessor, org.refcodes.web.RealmAccessor.RealmBuilder<RestServer>, org.refcodes.web.RealmAccessor.RealmMutator, org.refcodes.web.RealmAccessor.RealmProperty, org.refcodes.web.SchemeAccessor, org.refcodes.web.SchemeAccessor.SchemeBuilder<HttpRestServer>, org.refcodes.web.SchemeAccessor.SchemeMutator, org.refcodes.web.SchemeAccessor.SchemeProperty, org.refcodes.web.VirtualHostAccessor, org.refcodes.web.VirtualHostAccessor.VirtualHostBuilder<B>, org.refcodes.web.VirtualHostAccessor.VirtualHostMutator, org.refcodes.web.VirtualHostAccessor.VirtualHostProperty

public abstract class AbstractHttpRegistryRestServerDecorator<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>> extends AbstractHttpRestServerDecorator<B> implements HttpRegistryRestServer<DESC,B>
Abstract class for easily decorating a HttpRegistryRestServer.
  • Field Details

    • _lifeCycleAutomaton

      protected org.refcodes.component.LifecycleAutomatonImpl.ManualLifecycleAutomatonImpl _lifeCycleAutomaton
    • _pingRequestObserver

      protected RestRequestConsumer _pingRequestObserver
  • Constructor Details

    • AbstractHttpRegistryRestServerDecorator

      public AbstractHttpRegistryRestServerDecorator(HttpRestServer aServer)
      Decorates the given HttpRestServer with discovery functionality.
      Parameters:
      aServer - The HttpRestServer to be decorated.
  • Method Details

    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.refcodes.component.RunningAccessor
    • isInitialized

      public boolean isInitialized()
      Specified by:
      isInitialized in interface org.refcodes.component.InitializedAccessor
    • getLifecycleStatus

      public org.refcodes.component.LifecycleStatus getLifecycleStatus()
      Specified by:
      getLifecycleStatus in interface org.refcodes.component.LifecycleStatusAccessor
    • pause

      public void pause() throws org.refcodes.component.PauseException
      Some "deactivated" status is communicated to the registry server. The registered RestEndpoint instances (observers) (e.g. via RestEndpointBuilder being registered e.g. via RestServer.onRequest(org.refcodes.web.HttpMethod, String, RestRequestConsumer), RestServer.onGet(String, RestRequestConsumer) RestServer.onPut(String, RestRequestConsumer), RestServer.onPut(String, RestRequestConsumer) or RestServer.onDelete(String, RestRequestConsumer) is closed by calling its RestEndpointBuilder.close()) are disabled by calling Observers.disableObservers(). Some "deactivated" status is communicated to the registry server.
      Specified by:
      pause in interface HttpRegistry<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      pause in interface HttpRegistryRestServer<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      pause in interface org.refcodes.component.Pausable
      Throws:
      org.refcodes.component.PauseException
    • stop

      public void stop() throws org.refcodes.component.StopException
      Some "out-of-order" status is communicated to the registry server. The registered RestEndpoint instances (observers) (e.g. via RestServer.onRequest(org.refcodes.web.HttpMethod, String, RestRequestConsumer), RestServer.onGet(String, RestRequestConsumer) RestServer.onPut(String, RestRequestConsumer), RestServer.onPut(String, RestRequestConsumer) or RestServer.onDelete(String, RestRequestConsumer)) are disabled by calling Observers.disableObservers(). Also stops a "ping" or "heartbeat" daemon. Some "out-of-order" status is communicated to the registry server. Also stops a "ping" or "heartbeat" daemon.
      Specified by:
      stop in interface HttpRegistry<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      stop in interface HttpRegistryRestServer<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      stop in interface org.refcodes.component.Stoppable
      Throws:
      org.refcodes.component.StopException
    • start

      public void start() throws org.refcodes.component.StartException
      Some "up-and-running" status is communicated to the registry server. The registered RestEndpoint instances (observers) (e.g. via RestServer.onRequest(org.refcodes.web.HttpMethod, String, RestRequestConsumer), RestServer.onGet(String, RestRequestConsumer) RestServer.onPut(String, RestRequestConsumer), RestServer.onPut(String, RestRequestConsumer) or RestServer.onDelete(String, RestRequestConsumer)) are enabled by calling Observers.enableObservers(). If necessary, the connection is opened via HttpRestServer.open() or the like. May also start a "ping" or "heartbeat" daemon. Some "up-and-running" status is communicated to the registry server. May also start a "ping" or "heartbeat" daemon.
      Specified by:
      start in interface HttpRegistry<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      start in interface HttpRegistryRestServer<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      start in interface org.refcodes.component.Startable
      Throws:
      org.refcodes.component.StartException
    • resume

      public void resume() throws org.refcodes.component.ResumeException
      Some "up-and-running (again)" status is communicated to the registry server. The registered RestEndpoint instances (observers) (e.g. via RestEndpointBuilder being registered e.g. via RestServer.onRequest(org.refcodes.web.HttpMethod, String, RestRequestConsumer), RestServer.onGet(String, RestRequestConsumer) RestServer.onPut(String, RestRequestConsumer), RestServer.onPut(String, RestRequestConsumer) or RestServer.onDelete(String, RestRequestConsumer) is closed by calling its RestEndpointBuilder.close()) are enabled (again) by calling Observers.enableObservers(). Some "up-and-running (again)" status is communicated to the registry server.
      Specified by:
      resume in interface HttpRegistry<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      resume in interface HttpRegistryRestServer<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      resume in interface org.refcodes.component.Resumable
      Throws:
      org.refcodes.component.ResumeException
    • initialize

      public void initialize() throws org.refcodes.component.InitializeException
      Initializes the HttpRegistry by registering it at the service registry with a status such as "starting" or "initializing" or "not-ready-yet".
      Specified by:
      initialize in interface HttpRegistry<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      initialize in interface org.refcodes.component.Initializable
      Throws:
      org.refcodes.component.InitializeException
    • isStoppable

      public boolean isStoppable()
      Specified by:
      isStoppable in interface org.refcodes.component.Stoppable.StopAutomaton
    • isPausable

      public boolean isPausable()
      Specified by:
      isPausable in interface org.refcodes.component.Pausable.PauseAutomaton
    • isStartable

      public boolean isStartable()
      Specified by:
      isStartable in interface org.refcodes.component.Startable.StartAutomaton
    • isResumable

      public boolean isResumable()
      Specified by:
      isResumable in interface org.refcodes.component.Resumable.ResumeAutomaton
    • isStopped

      public boolean isStopped()
      Specified by:
      isStopped in interface org.refcodes.component.Stoppable.StopAutomaton
    • isPaused

      public boolean isPaused()
      Specified by:
      isPaused in interface org.refcodes.component.Pausable.PauseAutomaton
    • isInitalizable

      public boolean isInitalizable()
      Specified by:
      isInitalizable in interface org.refcodes.component.Initializable.InitializeAutomaton
    • destroy

      public void destroy()
      This server is taken (removed) from the registry server. The registered RestEndpoint instances (observers) (e.g. via RestServer.onRequest(org.refcodes.web.HttpMethod, String, RestRequestConsumer), RestServer.onGet(String, RestRequestConsumer) RestServer.onPut(String, RestRequestConsumer), RestServer.onPut(String, RestRequestConsumer) or RestServer.onDelete(String, RestRequestConsumer)) are disabled by calling Observers.disableObservers(). Also stops a "ping" or "heartbeat" daemon. Finally the connection is closed via Closable.close(). This server is taken (removed) from the registry server. Also stops a "ping" or "heartbeat" daemon. Finally the connection is closed.
      Specified by:
      destroy in interface org.refcodes.component.Destroyable
      Specified by:
      destroy in interface HttpRegistry<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
      Specified by:
      destroy in interface HttpRegistryRestServer<DESC extends HttpServerDescriptor,B extends HttpRegistryRestServer<DESC,B>>
    • isDestroyable

      public boolean isDestroyable()
      Specified by:
      isDestroyable in interface org.refcodes.component.Destroyable.DestroyAutomaton
    • isDestroyed

      public boolean isDestroyed()
      Specified by:
      isDestroyed in interface org.refcodes.component.Destroyable.DestroyAutomaton
    • setInstanceId

      public void setInstanceId(String aInstanceId)
      Specified by:
      setInstanceId in interface org.refcodes.mixin.InstanceIdAccessor.InstanceIdMutator
    • getInstanceId

      public String getInstanceId()
      Specified by:
      getInstanceId in interface org.refcodes.mixin.InstanceIdAccessor
    • setHost

      public void setHost(String aHost)
      Specified by:
      setHost in interface org.refcodes.web.HostAccessor.HostMutator
    • getHost

      public String getHost()
      Specified by:
      getHost in interface org.refcodes.web.HostAccessor
    • getVirtualHost

      public String getVirtualHost()
      Specified by:
      getVirtualHost in interface org.refcodes.web.VirtualHostAccessor
    • setVirtualHost

      public void setVirtualHost(String aVirtualHost)
      Specified by:
      setVirtualHost in interface org.refcodes.web.VirtualHostAccessor.VirtualHostMutator
    • getIpAddress

      public int[] getIpAddress()
      Specified by:
      getIpAddress in interface org.refcodes.net.IpAddressAccessor
    • setIpAddress

      public void setIpAddress(int[] aIpAddress)
      Specified by:
      setIpAddress in interface org.refcodes.net.IpAddressAccessor.IpAddressMutator
    • getTrustStoreDescriptor

      public org.refcodes.security.TrustStoreDescriptor getTrustStoreDescriptor()
      Specified by:
      getTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor
    • setTrustStoreDescriptor

      public void setTrustStoreDescriptor(org.refcodes.security.TrustStoreDescriptor aTrustStoreDescriptor)
      Specified by:
      setTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
    • getHttpServerDescriptor

      public DESC getHttpServerDescriptor()
      Retrieves the HttpServerDescriptor from the HttpServerDescriptor property.
      Specified by:
      getHttpServerDescriptor in interface HttpServerDescriptorAccessor<DESC extends HttpServerDescriptor>
      Returns:
      The HttpServerDescriptor stored by the HttpServerDescriptor property.
    • setHttpServerDescriptor

      public void setHttpServerDescriptor(DESC aServerDescriptor)
      Sets the HttpServerDescriptor for the HttpServerDescriptor property.
      Specified by:
      setHttpServerDescriptor in interface HttpServerDescriptorAccessor.HttpServerDescriptorMutator<DESC extends HttpServerDescriptor>
      Parameters:
      aServerDescriptor - The HttpServerDescriptor to be stored by the HttpServerDescriptor property.
    • getHttpRegistryUrl

      public org.refcodes.web.Url getHttpRegistryUrl()
      Retrieves the URL from the URL property locating the service registry registry.
      Specified by:
      getHttpRegistryUrl in interface HttpRegistryUrlAccessor
      Returns:
      The URL stored by the URL property.
    • setHttpRegistryUrl

      public void setHttpRegistryUrl(org.refcodes.web.Url aRegistryUrl)
      Sets the URL for the URL property locating the service registry registry.
      Specified by:
      setHttpRegistryUrl in interface HttpRegistryUrlAccessor.HttpRegistryUrlMutator
      Parameters:
      aRegistryUrl - The service registry registry URL to be stored by the URL property.
    • getAlias

      public String getAlias()
      Specified by:
      getAlias in interface org.refcodes.mixin.AliasAccessor
    • setAlias

      public void setAlias(String aAlias)
      Specified by:
      setAlias in interface org.refcodes.mixin.AliasAccessor.AliasMutator
    • getPingPath

      public String getPingPath()
      Retrieves the ping path from the ping path property.
      Specified by:
      getPingPath in interface PingPathAccessor
      Returns:
      The ping path stored by the ping path property.
    • setPingPath

      public void setPingPath(String aPingPath)
      Sets the ping path for the ping path property.
      Specified by:
      setPingPath in interface PingPathAccessor.PingPathMutator
      Parameters:
      aPingPath - The ping path to be stored by the ping path property.
    • onPingRequest

      public void onPingRequest(RestRequestConsumer aRequestConsumer)
      Sets the ping RestRequestConsumer listening for "ping" requests.
      Specified by:
      onPingRequest in interface PingRequestObserver
      Parameters:
      aRequestConsumer - The ping RestRequestConsumer to be registered.
    • getPingRequestObserver

      public RestRequestConsumer getPingRequestObserver()
      Retrieves the ping RestRequestConsumer from the ping RestRequestConsumer property.
      Specified by:
      getPingRequestObserver in interface PingRequestObserverAccessor
      Returns:
      The ping RestRequestConsumer stored by the ping RestRequestConsumer property.
    • toHost

      protected String toHost(String aHost) throws UnknownHostException
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aHost - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
      Throws:
      UnknownHostException - thrown in case the local machine's host cannot be resolved when the provided host is null.
    • toVirtualHost

      protected String toVirtualHost(String aVirtualHost)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aVirtualHost - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toIpAddress

      protected int[] toIpAddress(int[] aIpAddress) throws IOException
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aIpAddress - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
      Throws:
      IOException - thrown in case the local machine's IP-Address cannot be resolved when the provided IP-Address is null.
    • toAlias

      protected String toAlias(String aAlias)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aAlias - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toScheme

      protected org.refcodes.data.Scheme toScheme(org.refcodes.data.Scheme aScheme)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aScheme - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toPort

      protected int toPort(int aPort)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aPort - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toInstanceId

      protected String toInstanceId(String aInstanceId, String aHost)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aInstanceId - The value to be used when not null.
      aHost - The value to be used when instance TID is null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toPingPath

      protected String toPingPath(String aPingPath, String aDefaultPingPath)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aPingPath - The value to be used when not null.
      aDefaultPingPath - The value to be used when the ping path is null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toTrustStoreDescriptor

      protected org.refcodes.security.TrustStoreDescriptor toTrustStoreDescriptor(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aStoreDescriptor - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toHttpRegistryUrl

      protected org.refcodes.web.Url toHttpRegistryUrl(org.refcodes.web.Url aRegistryUrl)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aRegistryUrl - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toHttpServerDescriptor

      protected DESC toHttpServerDescriptor(DESC aServerDescriptor)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aServerDescriptor - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.
    • toPingObserver

      protected RestRequestConsumer toPingObserver(RestRequestConsumer aPingRequestObserver)
      Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
      Parameters:
      aPingRequestObserver - The value to be used when not null.
      Returns:
      The value when not null, else the value of this instance's property.