Skip to content

Commit

Permalink
Rename all Builder classes to use BuilderScope terminologity (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Aug 23, 2024
1 parent c727011 commit feec32c
Show file tree
Hide file tree
Showing 28 changed files with 674 additions and 580 deletions.
77 changes: 42 additions & 35 deletions library/runtime-core/api/runtime-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public final class io/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPo
public fun toString ()Ljava/lang/String;
}

public final class io/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPolicy$Builder {
public final fun cancellation (Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPolicy$Builder;
public final class io/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPolicy$BuilderScope {
public final fun cancellation (Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPolicy$BuilderScope;
}

public final class io/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPolicy$Cancellation {
Expand All @@ -102,7 +102,7 @@ public final class io/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPo
public fun toString ()Ljava/lang/String;
}

public final class io/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPolicy$Cancellation$Builder {
public final class io/matthewnelson/kmp/tor/runtime/core/EnqueuedJob$ExecutionPolicy$Cancellation$BuilderScope {
public field accessibilityOpen Z
public field allowAttempts Z
public field substituteErrorWithAttempt Z
Expand Down Expand Up @@ -637,34 +637,6 @@ public final class io/matthewnelson/kmp/tor/runtime/core/address/Port$ZERO : io/
public static final field INSTANCE Lio/matthewnelson/kmp/tor/runtime/core/address/Port$ZERO;
}

public final class io/matthewnelson/kmp/tor/runtime/core/builder/OnionAddBuilder : io/matthewnelson/kmp/tor/runtime/core/config/builder/BuilderScopeHSPort$DSL {
public field destroyKeyOnJobCompletion Z
public synthetic fun <init> (Lio/matthewnelson/kmp/tor/runtime/core/key/KeyType$Address;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun clientAuth (Lio/matthewnelson/kmp/tor/runtime/core/key/X25519$PublicKey;)Lio/matthewnelson/kmp/tor/runtime/core/builder/OnionAddBuilder;
public final fun flags (Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/builder/OnionAddBuilder;
public final fun maxStreams (I)Lio/matthewnelson/kmp/tor/runtime/core/builder/OnionAddBuilder;
public fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;)Lio/matthewnelson/kmp/tor/runtime/core/builder/OnionAddBuilder;
public synthetic fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;)Lio/matthewnelson/kmp/tor/runtime/core/config/builder/BuilderScopeHSPort$DSL;
public fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/builder/OnionAddBuilder;
public synthetic fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/config/builder/BuilderScopeHSPort$DSL;
}

public final class io/matthewnelson/kmp/tor/runtime/core/builder/OnionAddBuilder$FlagBuilder {
public field Detach Ljava/lang/Boolean;
public field DiscardPK Ljava/lang/Boolean;
public field MaxStreamsCloseCircuit Ljava/lang/Boolean;
}

public final class io/matthewnelson/kmp/tor/runtime/core/builder/OnionClientAuthAddBuilder {
public field clientName Ljava/lang/String;
public field destroyKeyOnJobCompletion Z
public final fun flags (Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/builder/OnionClientAuthAddBuilder;
}

public final class io/matthewnelson/kmp/tor/runtime/core/builder/OnionClientAuthAddBuilder$FlagBuilder {
public field Permanent Ljava/lang/Boolean;
}

public abstract interface class io/matthewnelson/kmp/tor/runtime/core/config/ConfigurableContract {
}

Expand Down Expand Up @@ -4011,15 +3983,22 @@ public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion {
}

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Add : io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Unprivileged {
public final field addressKey Lio/matthewnelson/kmp/tor/runtime/core/key/AddressKey$Private;
public static final field Companion Lio/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Add$Companion;
public final field clientAuth Ljava/util/Set;
public final field destroyKeyOnJobCompletion Z
public final field flags Ljava/util/Set;
public final field key Lio/matthewnelson/kmp/tor/runtime/core/key/AddressKey$Private;
public final field keyType Lio/matthewnelson/kmp/tor/runtime/core/key/KeyType$Address;
public final field maxStreams Ljava/lang/Integer;
public final field ports Ljava/util/Set;
public fun <init> (Lio/matthewnelson/kmp/tor/runtime/core/key/AddressKey$Private;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)V
public fun <init> (Lio/matthewnelson/kmp/tor/runtime/core/key/KeyType$Address;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)V
public synthetic fun <init> (Lio/matthewnelson/kmp/tor/runtime/core/key/AddressKey$Private;Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd$Arguments;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public static final fun existing (Lio/matthewnelson/kmp/tor/runtime/core/key/AddressKey$Private;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Add;
public static final fun new (Lio/matthewnelson/kmp/tor/runtime/core/key/KeyType$Address;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Add;
}

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Add$Companion {
public final fun existing (Lio/matthewnelson/kmp/tor/runtime/core/key/AddressKey$Private;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Add;
public final fun new (Lio/matthewnelson/kmp/tor/runtime/core/key/KeyType$Address;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Add;
}

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Onion$Delete : io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Unprivileged {
Expand All @@ -4037,10 +4016,10 @@ public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$OnionClient

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$OnionClientAuth$Add : io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Unprivileged {
public final field address Lio/matthewnelson/kmp/tor/runtime/core/address/OnionAddress;
public final field authKey Lio/matthewnelson/kmp/tor/runtime/core/key/AuthKey$Private;
public final field clientName Ljava/lang/String;
public final field destroyKeyOnJobCompletion Z
public final field flags Ljava/util/Set;
public final field key Lio/matthewnelson/kmp/tor/runtime/core/key/AuthKey$Private;
public fun <init> (Lio/matthewnelson/kmp/tor/runtime/core/address/OnionAddress$V3;Lio/matthewnelson/kmp/tor/runtime/core/key/X25519$PrivateKey;)V
public fun <init> (Lio/matthewnelson/kmp/tor/runtime/core/address/OnionAddress$V3;Lio/matthewnelson/kmp/tor/runtime/core/key/X25519$PrivateKey;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)V
}
Expand Down Expand Up @@ -4179,6 +4158,34 @@ public abstract interface class io/matthewnelson/kmp/tor/runtime/core/ctrl/TorCm
public abstract fun enqueue (Lio/matthewnelson/kmp/tor/runtime/core/ctrl/TorCmd$Unprivileged;Lio/matthewnelson/kmp/tor/runtime/core/OnFailure;Lio/matthewnelson/kmp/tor/runtime/core/OnSuccess;)Lio/matthewnelson/kmp/tor/runtime/core/EnqueuedJob;
}

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeClientAuthAdd {
public final fun clientName (Ljava/lang/String;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeClientAuthAdd;
public final fun destroyKeyOnJobCompletion (Z)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeClientAuthAdd;
public final fun flags (Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeClientAuthAdd;
}

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeClientAuthAdd$FlagsBuilder {
public field Permanent Ljava/lang/Boolean;
}

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd : io/matthewnelson/kmp/tor/runtime/core/config/builder/BuilderScopeHSPort$DSL {
public synthetic fun <init> (Lio/matthewnelson/kmp/tor/runtime/core/key/KeyType$Address;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun clientAuth (Lio/matthewnelson/kmp/tor/runtime/core/key/X25519$PublicKey;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd;
public final fun destroyKeyOnJobCompletion (Z)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd;
public final fun flags (Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd;
public final fun maxStreams (I)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd;
public synthetic fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;)Lio/matthewnelson/kmp/tor/runtime/core/config/builder/BuilderScopeHSPort$DSL;
public fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd;
public synthetic fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/config/builder/BuilderScopeHSPort$DSL;
public fun port (Lio/matthewnelson/kmp/tor/runtime/core/address/Port;Lio/matthewnelson/kmp/tor/runtime/core/ThisBlock;)Lio/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd;
}

public final class io/matthewnelson/kmp/tor/runtime/core/ctrl/builder/BuilderScopeOnionAdd$FlagsBuilder {
public field Detach Ljava/lang/Boolean;
public field DiscardPK Ljava/lang/Boolean;
public field MaxStreamsCloseCircuit Ljava/lang/Boolean;
}

public final class io/matthewnelson/kmp/tor/runtime/core/key/AddressKey {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ public abstract class EnqueuedJob protected constructor(
* */
@JvmStatic
public fun Builder(
block: ThisBlock<Builder>,
): ExecutionPolicy = Builder.get().apply(block).build()
block: ThisBlock<BuilderScope>,
): ExecutionPolicy = BuilderScope.get().apply(block).build()
}

/**
Expand Down Expand Up @@ -395,7 +395,7 @@ public abstract class EnqueuedJob protected constructor(
}

@KmpTorDsl
public class Builder private constructor() {
public class BuilderScope private constructor() {

/**
* Default: `false`
Expand Down Expand Up @@ -444,7 +444,8 @@ public abstract class EnqueuedJob protected constructor(

internal companion object {
@JvmSynthetic
internal fun get(): Builder = Builder()
internal fun get(): BuilderScope =
BuilderScope()
}
}

Expand All @@ -462,14 +463,14 @@ public abstract class EnqueuedJob protected constructor(
* @see [ExecutionPolicy.Companion.Builder]
* */
@KmpTorDsl
public class Builder private constructor() {
public class BuilderScope private constructor() {

private val _cancellation = Cancellation.Builder.get()
private val _cancellation = Cancellation.BuilderScope.get()

@KmpTorDsl
public fun cancellation(
block: ThisBlock<Cancellation.Builder>,
): Builder = apply { _cancellation.apply(block) }
block: ThisBlock<Cancellation.BuilderScope>,
): BuilderScope = apply { _cancellation.apply(block) }

@JvmSynthetic
internal fun build(): ExecutionPolicy {
Expand All @@ -489,7 +490,7 @@ public abstract class EnqueuedJob protected constructor(
internal companion object {

@JvmSynthetic
internal fun get(): Builder = Builder()
internal fun get(): BuilderScope = BuilderScope()
}
}

Expand Down
Loading

0 comments on commit feec32c

Please sign in to comment.