-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dlp: add a utility conversion function #3028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pongad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the contrary, most things look right :)
|
|
||
| private ColorUtil() {} | ||
|
|
||
| public static final Color convert(java.awt.Color c) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| private ColorUtil() {} | ||
|
|
||
| public static final Color convert(java.awt.Color c) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| import com.google.privacy.dlp.v2beta1.Color; | ||
|
|
||
| public class ColorUtil { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| .setGreen(c.getGreen()) | ||
| .setRed(c.getRed()) | ||
| .build(); | ||
| } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@garrettjonesgoogle PTAL and lmk if anything else to fix up! |
| Color got = Colors.asDlpColor(java.awt.Color.GREEN); | ||
| Assert.assertEquals(got.getBlue(), 0, 0); | ||
| Assert.assertEquals(got.getGreen(), 255, 0); | ||
| Assert.assertEquals(got.getRed(), 0, 0); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| private Colors() {} | ||
|
|
||
| public static final Color asDlpColor(java.awt.Color c) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@garrettjonesgoogle PTAL |
garrettjonesgoogle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There's a lot about this I'm unsure about, since this is my first commit. So, sorry if a lot is wrong here.
Fixes #2321