Package 

Class FlagsClient.Builder


  • 
    public final class FlagsClient.Builder
    
                        

    Builder for creating FlagsClient instances with custom configuration.

    The builder uses a selective override pattern: configuration fields set explicitly on the builder override the defaults from FlagsFeature. Fields not set on the builder use the feature-level defaults.

    Default FlagsClient:

    val client = FlagsClient.Builder().build()

    Named FlagsClient:

    val client = FlagsClient.Builder("analytics").build()

    With custom SDK core:

    val client = FlagsClient.Builder(sdkCore = customCore)
        .build()
    • Method Summary

      Modifier and Type Method Description
      final FlagsClient build() Builds and registers a FlagsClient instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlagsClient.Builder

        FlagsClient.Builder(String name, SdkCore sdkCore)
        Creates a builder for a named FlagsClient.
        Parameters:
        name - the client name.
        sdkCore - the SDK instance to associate with this client.
    • Method Detail

      • build

         final FlagsClient build()

        Builds and registers a FlagsClient instance.

        This method:

        • Validates the FlagsFeature is enabled

        • Creates and registers the client

        • Returns the created client or NoOpFlagsClient on failure

        If a FlagsClient with the same name already exists for this SdkCore:

        • Logs a warning according to the graceful mode policy

        • Returns the existing FlagsClient

        • In strict mode (debug builds with gracefulModeEnabled=false), throws an exception