You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not blocking this PR, but it seems we are repeating this pattern of a triple of endpoint / cluster / <target: attribute / command ID> all over for read/write/subscribe/invoke which ends up propagating into several overloads for raw integers vs object wrappers. Perhaps we could refactor this into a containing object with a builder that takes integer vs object for each property? Something like:
public final class InteractionTarget {
private final ChipPathId endpointId;
private final ChipPathId clusterId;
private final ChipPathId targetId;
public static final class Builder {
private ChipPathId endpointId = ChipPathId.forWildcard();
private ChipPathId clusterId = ChipPathId.forWildcard();
private ChipPathId targetId = ChipPathId.forWildcard();
public Builder setEndpointId(int endpointId) {
this.endpointId = ChipPathId.forId(endpointId);
return this;
}
public Builder setEndpointId(ChipPathId endpointId) {
this.endpointId = endpointId;
return this;
}
// Same for clusterId and targetId
public InteractionTarget build() {
return new InteractionTarget(endpointId, clusterId, targetId);
}
}
}
This way each of these Element classes can just take in an InteractionTarget and not have to require so many overloads.
This way each of these
Element
classes can just take in anInteractionTarget
and not have to require so many overloads.Originally posted by @g-coppock in #25476 (comment)
The text was updated successfully, but these errors were encountered: