This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
processor/src/main/java/com/instagram/common/json/annotation/processor/StringUtil.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,13 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
package com.instagram.common.json.annotation.processor; | ||
|
||
public class StringUtil { | ||
|
||
/** | ||
* We don't want to pull in guava strings just for this one function. | ||
*/ | ||
/*package*/ static boolean isNullOrEmpty(String string) { | ||
return string == null || string.isEmpty(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...in/java/com/instagram/common/json/annotation/processor/SubclassWithAbstractParentUUT.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,18 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
package com.instagram.common.json.annotation.processor.dependent; | ||
|
||
import com.instagram.common.json.annotation.JsonField; | ||
import com.instagram.common.json.annotation.JsonType; | ||
import com.instagram.common.json.annotation.processor.parent.AbstractParentUUT; | ||
|
||
/** | ||
* UUT with abstract superclass. | ||
*/ | ||
@JsonType | ||
public class SubclassWithAbstractParentUUT extends AbstractParentUUT { | ||
public static final String SUBCLASS_INT_KEY = "subclass_int"; | ||
|
||
@JsonField(fieldName = SUBCLASS_INT_KEY) | ||
public int subclassInt; | ||
} |
21 changes: 21 additions & 0 deletions
21
...arent/src/main/java/com/instagram/common/json/annotation/processor/AbstractParentUUT.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,21 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
package com.instagram.common.json.annotation.processor.parent; | ||
|
||
import com.instagram.common.json.annotation.JsonField; | ||
import com.instagram.common.json.annotation.JsonType; | ||
|
||
/** | ||
* Abstract parent class to test that abstract parent classes are processed properly. | ||
*/ | ||
@JsonType | ||
public abstract class AbstractParentUUT { | ||
public static final String PARENT_STRING_KEY = "parent_string"; | ||
public static final String PARENT_INT_KEY = "parent_int"; | ||
|
||
@JsonField(fieldName = PARENT_STRING_KEY) | ||
public String parentString; | ||
|
||
@JsonField(fieldName = PARENT_INT_KEY) | ||
public int parentInt; | ||
} |