-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix externalmodes RouerValue Duration * Remove @generated * Remove @generated annotations * Remove @generated * Fix build * Remove @generated; Fix method to use BinaryData * Add Proxies * Add ConstructorProxy classes * Fix tests * Fix build * Remove unused import * Fix linting errors
- Loading branch information
1 parent
42e4ce3
commit f1f1728
Showing
59 changed files
with
2,079 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...nication/jobrouter/implementation/accesshelpers/ClassificationPolicyConstructorProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.communication.jobrouter.implementation.accesshelpers; | ||
|
||
import com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal; | ||
import com.azure.communication.jobrouter.models.ClassificationPolicy; | ||
|
||
/** | ||
* Helper class to access private values of {@link ClassificationPolicy} across package boundaries. | ||
*/ | ||
public final class ClassificationPolicyConstructorProxy { | ||
|
||
private static ClassificationPolicyConstructorAccessor accessor; | ||
|
||
private ClassificationPolicyConstructorProxy() { } | ||
|
||
/** | ||
* Type defining the methods to set the non-public properties of a {@link ClassificationPolicyConstructorAccessor} | ||
* instance. | ||
*/ | ||
public interface ClassificationPolicyConstructorAccessor { | ||
/** | ||
* Creates a new instance of {@link ClassificationPolicy} backed by an internal instance of | ||
* {@link ClassificationPolicy}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link ClassificationPolicy}. | ||
*/ | ||
ClassificationPolicy create(ClassificationPolicyInternal internal); | ||
} | ||
|
||
/** | ||
* The method called from {@link ClassificationPolicy} to set it's accessor. | ||
* | ||
* @param accessor The accessor. | ||
*/ | ||
public static void setAccessor(final ClassificationPolicyConstructorAccessor accessor) { | ||
ClassificationPolicyConstructorProxy.accessor = accessor; | ||
} | ||
|
||
/** | ||
* Creates a new instance of {@link ClassificationPolicy} backed by an internal instance of | ||
* {@link ClassificationPolicyInternal}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link ClassificationPolicy}. | ||
*/ | ||
public static ClassificationPolicy create(ClassificationPolicyInternal internal) { | ||
// This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the | ||
// application accesses RouterJob which triggers the accessor to be configured. So, if the accessor | ||
// is null this effectively pokes the class to set up the accessor. | ||
if (accessor == null) { | ||
new ClassificationPolicy(); | ||
} | ||
|
||
assert accessor != null; | ||
return accessor.create(internal); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...munication/jobrouter/implementation/accesshelpers/DistributionPolicyConstructorProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.communication.jobrouter.implementation.accesshelpers; | ||
|
||
import com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal; | ||
import com.azure.communication.jobrouter.models.DistributionPolicy; | ||
|
||
/** | ||
* Helper class to access private values of {@link DistributionPolicy} across package boundaries. | ||
*/ | ||
public final class DistributionPolicyConstructorProxy { | ||
|
||
private static DistributionPolicyConstructorAccessor accessor; | ||
|
||
private DistributionPolicyConstructorProxy() { } | ||
|
||
/** | ||
* Type defining the methods to set the non-public properties of a {@link DistributionPolicyConstructorAccessor} | ||
* instance. | ||
*/ | ||
public interface DistributionPolicyConstructorAccessor { | ||
/** | ||
* Creates a new instance of {@link DistributionPolicy} backed by an internal instance of | ||
* {@link DistributionPolicy}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link DistributionPolicy}. | ||
*/ | ||
DistributionPolicy create(DistributionPolicyInternal internal); | ||
} | ||
|
||
/** | ||
* The method called from {@link DistributionPolicy} to set it's accessor. | ||
* | ||
* @param accessor The accessor. | ||
*/ | ||
public static void setAccessor(final DistributionPolicyConstructorAccessor accessor) { | ||
DistributionPolicyConstructorProxy.accessor = accessor; | ||
} | ||
|
||
/** | ||
* Creates a new instance of {@link DistributionPolicy} backed by an internal instance of | ||
* {@link DistributionPolicyInternal}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link DistributionPolicy}. | ||
*/ | ||
public static DistributionPolicy create(DistributionPolicyInternal internal) { | ||
// This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the | ||
// application accesses RouterJob which triggers the accessor to be configured. So, if the accessor | ||
// is null this effectively pokes the class to set up the accessor. | ||
if (accessor == null) { | ||
new DistributionPolicy(); | ||
} | ||
|
||
assert accessor != null; | ||
return accessor.create(internal); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...communication/jobrouter/implementation/accesshelpers/ExceptionPolicyConstructorProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.communication.jobrouter.implementation.accesshelpers; | ||
|
||
import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal; | ||
import com.azure.communication.jobrouter.models.ExceptionPolicy; | ||
|
||
/** | ||
* Helper class to access private values of {@link ExceptionPolicy} across package boundaries. | ||
*/ | ||
public final class ExceptionPolicyConstructorProxy { | ||
|
||
private static ExceptionPolicyConstructorAccessor accessor; | ||
|
||
private ExceptionPolicyConstructorProxy() { } | ||
|
||
/** | ||
* Type defining the methods to set the non-public properties of a {@link ExceptionPolicyConstructorAccessor} | ||
* instance. | ||
*/ | ||
public interface ExceptionPolicyConstructorAccessor { | ||
/** | ||
* Creates a new instance of {@link ExceptionPolicy} backed by an internal instance of | ||
* {@link ExceptionPolicy}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link ExceptionPolicy}. | ||
*/ | ||
ExceptionPolicy create(ExceptionPolicyInternal internal); | ||
} | ||
|
||
/** | ||
* The method called from {@link ExceptionPolicy} to set it's accessor. | ||
* | ||
* @param accessor The accessor. | ||
*/ | ||
public static void setAccessor(final ExceptionPolicyConstructorAccessor accessor) { | ||
ExceptionPolicyConstructorProxy.accessor = accessor; | ||
} | ||
|
||
/** | ||
* Creates a new instance of {@link ExceptionPolicy} backed by an internal instance of | ||
* {@link ExceptionPolicyInternal}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link ExceptionPolicy}. | ||
*/ | ||
public static ExceptionPolicy create(ExceptionPolicyInternal internal) { | ||
// This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the | ||
// application accesses RouterJob which triggers the accessor to be configured. So, if the accessor | ||
// is null this effectively pokes the class to set up the accessor. | ||
if (accessor == null) { | ||
new ExceptionPolicy(); | ||
} | ||
|
||
assert accessor != null; | ||
return accessor.create(internal); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
...azure/communication/jobrouter/implementation/accesshelpers/RouterJobConstructorProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.communication.jobrouter.implementation.accesshelpers; | ||
|
||
import com.azure.communication.jobrouter.implementation.models.RouterJobInternal; | ||
import com.azure.communication.jobrouter.models.RouterJob; | ||
|
||
/** | ||
* Helper class to access private values of {@link RouterJob} across package boundaries. | ||
*/ | ||
public final class RouterJobConstructorProxy { | ||
|
||
private static RouterJobConstructorAccessor accessor; | ||
|
||
private RouterJobConstructorProxy() { } | ||
|
||
/** | ||
* Type defining the methods to set the non-public properties of a {@link RouterJobConstructorAccessor} | ||
* instance. | ||
*/ | ||
public interface RouterJobConstructorAccessor { | ||
/** | ||
* Creates a new instance of {@link RouterJob} backed by an internal instance of | ||
* {@link RouterJob}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link RouterJob}. | ||
*/ | ||
RouterJob create(RouterJobInternal internal); | ||
} | ||
|
||
/** | ||
* The method called from {@link RouterJob} to set it's accessor. | ||
* | ||
* @param accessor The accessor. | ||
*/ | ||
public static void setAccessor(final RouterJobConstructorAccessor accessor) { | ||
RouterJobConstructorProxy.accessor = accessor; | ||
} | ||
|
||
/** | ||
* Creates a new instance of {@link RouterJob} backed by an internal instance of | ||
* {@link RouterJobInternal}. | ||
* | ||
* @param internal The internal response. | ||
* @return A new instance of {@link RouterJob}. | ||
*/ | ||
public static RouterJob create(RouterJobInternal internal) { | ||
// This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the | ||
// application accesses RouterJob which triggers the accessor to be configured. So, if the accessor | ||
// is null this effectively pokes the class to set up the accessor. | ||
if (accessor == null) { | ||
new RouterJob(); | ||
} | ||
|
||
assert accessor != null; | ||
return accessor.create(internal); | ||
} | ||
} |
Oops, something went wrong.