Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
f3ea13b3
Commit
f3ea13b3
authored
Jul 04, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use java string builder for toString methods
parent
8a0c7f3a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
27 deletions
+23
-27
ConfigChange.java
...n/java/com/ctrip/framework/apollo/model/ConfigChange.java
+9
-9
ApolloConfig.java
...ava/com/ctrip/framework/apollo/core/dto/ApolloConfig.java
+8
-10
ServiceDTO.java
.../java/com/ctrip/framework/apollo/core/dto/ServiceDTO.java
+6
-8
No files found.
apollo-client/src/main/java/com/ctrip/framework/apollo/model/ConfigChange.java
View file @
f3ea13b3
package
com
.
ctrip
.
framework
.
apollo
.
model
;
import
com.google.common.base.
More
Objects
;
import
com.google.common.base.Objects
;
import
com.ctrip.framework.apollo.enums.PropertyChangeType
;
...
...
@@ -67,13 +67,13 @@ public class ConfigChange {
@Override
public
String
toString
()
{
return
MoreObjects
.
toStringHelper
(
this
)
.
omitNullValues
()
.
add
(
"namespace"
,
namespace
)
.
add
(
"propertyName"
,
propertyName
)
.
add
(
"oldValue"
,
oldValue
)
.
add
(
"newValue"
,
newValue
)
.
add
(
"changeType"
,
changeType
)
.
toString
();
final
StringBuilder
sb
=
new
StringBuilder
(
"ConfigChange{"
);
sb
.
append
(
"namespace='"
).
append
(
namespace
).
append
(
'\''
);
sb
.
append
(
", propertyName='"
).
append
(
propertyName
).
append
(
'\''
);
sb
.
append
(
", oldValue='"
).
append
(
oldValue
).
append
(
'\''
);
sb
.
append
(
", newValue='"
).
append
(
newValue
).
append
(
'\''
);
sb
.
append
(
", changeType="
).
append
(
changeType
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
}
}
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ApolloConfig.java
View file @
f3ea13b3
package
com
.
ctrip
.
framework
.
apollo
.
core
.
dto
;
import
com.google.common.base.MoreObjects
;
import
java.util.Map
;
/**
...
...
@@ -74,13 +72,13 @@ public class ApolloConfig {
@Override
public
String
toString
()
{
return
MoreObjects
.
toStringHelper
(
this
)
.
omitNullValues
()
.
add
(
"appId"
,
appId
)
.
add
(
"cluster"
,
cluster
)
.
add
(
"namespaceName"
,
namespaceName
)
.
add
(
"releaseKey"
,
releaseKey
)
.
add
(
"configurations"
,
configurations
)
.
toString
();
final
StringBuilder
sb
=
new
StringBuilder
(
"ApolloConfig{"
);
sb
.
append
(
"appId='"
).
append
(
appId
).
append
(
'\''
);
sb
.
append
(
", cluster='"
).
append
(
cluster
).
append
(
'\''
);
sb
.
append
(
", namespaceName='"
).
append
(
namespaceName
).
append
(
'\''
);
sb
.
append
(
", configurations="
).
append
(
configurations
);
sb
.
append
(
", releaseKey='"
).
append
(
releaseKey
).
append
(
'\''
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
}
}
apollo-core/src/main/java/com/ctrip/framework/apollo/core/dto/ServiceDTO.java
View file @
f3ea13b3
package
com
.
ctrip
.
framework
.
apollo
.
core
.
dto
;
import
com.google.common.base.MoreObjects
;
public
class
ServiceDTO
{
private
String
appName
;
...
...
@@ -36,11 +34,11 @@ public class ServiceDTO {
@Override
public
String
toString
()
{
return
MoreObjects
.
toStringHelper
(
this
)
.
omitNullValues
()
.
add
(
"appName"
,
appName
)
.
add
(
"instanceId"
,
instanceId
)
.
add
(
"homepageUrl"
,
homepageUrl
)
.
toString
();
final
StringBuilder
sb
=
new
StringBuilder
(
"ServiceDTO{"
);
sb
.
append
(
"appName='"
).
append
(
appName
).
append
(
'\''
);
sb
.
append
(
", instanceId='"
).
append
(
instanceId
).
append
(
'\''
);
sb
.
append
(
", homepageUrl='"
).
append
(
homepageUrl
).
append
(
'\''
);
sb
.
append
(
'}'
);
return
sb
.
toString
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment