FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Deprecating *Type and getType() for resource names by garrettjonesgoogle · Pull Request #40 · googleapis/api-common-java · GitHub

This repository was archived by the owner on Sep 27, 2023. It is now read-only.
/ api-common-java Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or 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
Expand Up @@ -37,6 +37,11 @@
@BetaApi
public interface ResourceName {

/** The ResourceNameType of the resource name object. */
/**
* The ResourceNameType of the resource name object.
*
* @deprecated With Oneof types being converted to use inheritance, this is no longer necessary.
*/
@Deprecated
public ResourceNameType getType();
}
This file contains hidden or 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
Expand Up @@ -36,6 +36,9 @@
/**
* An interface that resource name types must implement. A ResourceNameType class is required for
* any class that implements {@link ResourceName}.
*
* @deprecated With Oneof types being converted to use inheritance, this is no longer necessary.
*/
@BetaApi
@Deprecated
public interface ResourceNameType {}
This file contains hidden or 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
Expand Up @@ -48,10 +48,18 @@ private UntypedResourceName(String rawValue) {
this.rawValue = Preconditions.checkNotNull(rawValue);
}

/**
* @deprecated use {@link #of(ResourceName)} instead.
*/
@Deprecated
public static UntypedResourceName from(ResourceName resourceName) {
return new UntypedResourceName(resourceName.toString());
}

public static UntypedResourceName of(ResourceName resourceName) {
return new UntypedResourceName(resourceName.toString());
}

public static UntypedResourceName parse(String formattedString) {
return new UntypedResourceName(formattedString);
}
Expand All @@ -60,7 +68,12 @@ public static boolean isParsableFrom(String formattedString) {
return true;
}

/*
* @deprecated With Oneof types being converted to use inheritance, this is
* no longer necessary.
*/
@Override
@Deprecated
public ResourceNameType getType() {
return UntypedResourceNameType.instance();
}
Expand Down
This file contains hidden or 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
Expand Up @@ -33,8 +33,13 @@

import com.google.api.core.BetaApi;

/** The ResourceNameType for {@link UntypedResourceName}. */
/**
* The ResourceNameType for {@link UntypedResourceName}.
*
* @deprecated With Oneof types being converted to use inheritance, this is no longer necessary.
*/
@BetaApi
@Deprecated
public class UntypedResourceNameType implements ResourceNameType {

private static UntypedResourceNameType instance = new UntypedResourceNameType();
Expand Down

Back | FazBrowse Home | New Git URL