-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* api review changes * reworking filesmbpropertieshelper * style
- Loading branch information
Showing
5 changed files
with
75 additions
and
30 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
57 changes: 57 additions & 0 deletions
57
...va/com/azure/storage/file/share/implementation/accesshelpers/FileSmbPropertiesHelper.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,57 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.storage.file.share.implementation.accesshelpers; | ||
|
||
import com.azure.core.http.HttpHeaders; | ||
import com.azure.storage.file.share.FileSmbProperties; | ||
|
||
/** | ||
* Helper class to access private values of {@link FileSmbProperties} across package boundaries. | ||
*/ | ||
public final class FileSmbPropertiesHelper { | ||
|
||
private static FileSmbPropertiesAccessor accessor; | ||
|
||
private FileSmbPropertiesHelper() { } | ||
|
||
|
||
/** | ||
* Type defining the methods to set the non-public properties of a {@link FileSmbProperties} instance. | ||
*/ | ||
public interface FileSmbPropertiesAccessor { | ||
/** | ||
* Creates a new instance of {@link FileSmbProperties} backed by an internal instance of | ||
* {@link FileSmbProperties}. | ||
* | ||
* @param httpHeaders The internal headers. | ||
* @return A new instance of {@link FileSmbProperties}. | ||
*/ | ||
FileSmbProperties create(HttpHeaders httpHeaders); | ||
} | ||
|
||
/** | ||
* The method called from {@link FileSmbProperties} to set it's accessor. | ||
* | ||
* @param accessor The accessor. | ||
*/ | ||
public static void setAccessor(final FileSmbPropertiesAccessor accessor) { | ||
FileSmbPropertiesHelper.accessor = accessor; | ||
} | ||
|
||
/** | ||
* Creates a new instance of {@link FileSmbProperties} backed by an internal instance of | ||
* {@link FileSmbProperties}. | ||
* | ||
* @param httpHeaders The internal headers. | ||
* @return A new instance of {@link FileSmbProperties}. | ||
*/ | ||
public static FileSmbProperties create(HttpHeaders httpHeaders) { | ||
if (accessor == null) { | ||
new FileSmbProperties(); | ||
} | ||
|
||
assert accessor != null; | ||
return accessor.create(httpHeaders); | ||
} | ||
} |
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