Skip to content

Commit

Permalink
refactor(oracle): introduce explicit constructor and initialization o…
Browse files Browse the repository at this point in the history
…f inner class members
  • Loading branch information
j-sandy committed Sep 14, 2023
1 parent 2104183 commit 6fc0328
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@ class OracleCluster {

@JsonIgnore
View getView() {
new View()
new View(this)
}

@Canonical
class View implements Cluster {

final String type = OracleCloudProvider.ID
final String name
final String accountName
final Set<OracleServerGroup.View> serverGroups
final Set<LoadBalancer> loadBalancers

View(OracleCluster oracleCluster){
name = oracleCluster.name
accountName = oracleCluster.accountName
serverGroups = oracleCluster.serverGroups.collect { OracleServerGroup it -> it.getView() } as Set
loadBalancers = [] as Set
}

String name = OracleCluster.this.name
String accountName = OracleCluster.this.accountName
Set<OracleServerGroup.View> serverGroups = OracleCluster.this.serverGroups.collect { it.getView() } as Set
Set<LoadBalancer> loadBalancers = [] as Set
}
}

0 comments on commit 6fc0328

Please sign in to comment.