Rename core references

Summary:
Only public reference touched is `toSonarObject()`.

The controller you requested could not be found.

Reviewed By: jknoxville

Differential Revision: D10009071

fbshipit-source-id: 985b472403d9ddd8e390620fb7896df93366dbef
This commit is contained in:
Pascal Hartig
2018-09-24 07:27:56 -07:00
committed by Facebook Github Bot
parent 41adb3bdaa
commit 079057727c
11 changed files with 27 additions and 27 deletions

View File

@@ -136,7 +136,7 @@ public class FlipperArray {
}
public Builder put(FlipperValue v) {
return put(v.toSonarObject());
return put(v.toFlipperObject());
}
public Builder put(FlipperArray a) {

View File

@@ -8,20 +8,20 @@
package com.facebook.flipper.core;
/**
* A connection between a FlipperPlugin and the desktop Sonar application. Register request handlers
* A connection between a FlipperPlugin and the desktop Flipper application. Register request handlers
* to respond to calls made by the desktop application or directly send messages to the desktop
* application.
*/
public interface FlipperConnection {
/**
* Call a remote method on the Sonar desktop application, passing an optional JSON object as a
* Call a remote method on the Flipper desktop application, passing an optional JSON object as a
* parameter.
*/
void send(String method, FlipperObject params);
/**
* Call a remote method on the Sonar desktop application, passing an optional JSON array as a
* Call a remote method on the Flipper desktop application, passing an optional JSON array as a
* parameter.
*/
void send(String method, FlipperArray params);
@@ -30,7 +30,7 @@ public interface FlipperConnection {
void reportError(Throwable throwable);
/**
* Register a receiver for a remote method call issued by the Sonar desktop application. The
* Register a receiver for a remote method call issued by the Flipper desktop application. The
* FlipperReceiver is passed a responder to respond back to the desktop application.
*/
void receive(String method, FlipperReceiver receiver);

View File

@@ -124,7 +124,7 @@ public class FlipperObject {
} else if (obj instanceof FlipperArray.Builder) {
return put(name, (FlipperArray.Builder) obj);
} else if (obj instanceof FlipperValue) {
return put(name, ((FlipperValue) obj).toSonarObject());
return put(name, ((FlipperValue) obj).toFlipperObject());
} else {
return put(name, obj.toString());
}
@@ -185,7 +185,7 @@ public class FlipperObject {
}
public Builder put(String name, FlipperValue v) {
return put(name, v.toSonarObject());
return put(name, v.toFlipperObject());
}
public Builder put(String name, FlipperArray a) {

View File

@@ -8,16 +8,16 @@
package com.facebook.flipper.core;
/**
* A FlipperPlugin is an object which exposes an API to the Desktop Sonar application. When a
* A FlipperPlugin is an object which exposes an API to the Desktop Flipper application. When a
* connection is established the plugin is given a FlipperConnection on which it can register request
* handlers and send messages. When the FlipperConnection is invalid onDisconnect is called. onConnect
* may be called again on the same plugin object if Sonar re-connects, this will provide a new
* may be called again on the same plugin object if Flipper re-connects, this will provide a new
* FlipperConnection, do not attempt to re-use the previous connection.
*/
public interface FlipperPlugin {
/**
* @return The id of this plugin. This is the namespace which Sonar desktop plugins will call
* @return The id of this plugin. This is the namespace which Flipper desktop plugins will call
* methods on to route them to your plugin. This should match the id specified in your React
* plugin.
*/

View File

@@ -8,13 +8,13 @@
package com.facebook.flipper.core;
/**
* A receiver of a remote method call issued by the Sonar desktop application. If the given
* responder is present it means the Sonar desktop application is expecting a response.
* A receiver of a remote method call issued by the Flipper desktop application. If the given
* responder is present it means the Flipper desktop application is expecting a response.
*/
public interface FlipperReceiver {
/**
* Reciver for a request sent from the Sonar desktop client.
* Reciver for a request sent from the Flipper desktop client.
*
* @param params Optional set of parameters sent with the request.
* @param responder Optional responder for request. Some requests don't warrant a response

View File

@@ -8,21 +8,21 @@
package com.facebook.flipper.core;
/**
* FlipperResponder is used to asyncronously response to a messaged recieved from the Sonar desktop
* app. The Sonar Responder will automatically wrap the response in an approriate object depending
* FlipperResponder is used to asyncronously response to a messaged recieved from the Flipper desktop
* app. The Flipper Responder will automatically wrap the response in an approriate object depending
* on if it is an error or not.
*/
public interface FlipperResponder {
/** Deliver a successful response to the Sonar desktop app. */
/** Deliver a successful response to the Flipper desktop app. */
void success(FlipperObject response);
/** Deliver a successful response to the Sonar desktop app. */
/** Deliver a successful response to the Flipper desktop app. */
void success(FlipperArray response);
/** Deliver a successful response to the Sonar desktop app. */
/** Deliver a successful response to the Flipper desktop app. */
void success();
/** Inform the Sonar desktop app of an error in handling the request. */
/** Inform the Flipper desktop app of an error in handling the request. */
void error(FlipperObject response);
}

View File

@@ -8,5 +8,5 @@
package com.facebook.flipper.core;
public interface FlipperValue {
FlipperObject toSonarObject();
FlipperObject toFlipperObject();
}

View File

@@ -391,7 +391,7 @@ public class InspectorFlipperPlugin implements FlipperPlugin {
final boolean axEnabled = params.getBoolean("axEnabled");
final SearchResultNode matchTree = searchTree(query.toLowerCase(), mApplication, axEnabled);
final FlipperObject results = matchTree == null ? null : matchTree.toSonarObject();
final FlipperObject results = matchTree == null ? null : matchTree.toFlipperObject();
final FlipperObject response =
new FlipperObject.Builder().put("results", results).put("query", query).build();
responder.success(response);

View File

@@ -69,7 +69,7 @@ public class InspectorValue<T> implements FlipperValue {
}
@Override
public FlipperObject toSonarObject() {
public FlipperObject toFlipperObject() {
return new FlipperObject.Builder()
.put("__type__", mType)
.put("__mutable__", mMutable)

View File

@@ -31,12 +31,12 @@ public class SearchResultNode {
this.axElement = axElement;
}
FlipperObject toSonarObject() {
FlipperObject toFlipperObject() {
final FlipperArray childArray;
if (children != null) {
final FlipperArray.Builder builder = new FlipperArray.Builder();
for (SearchResultNode child : children) {
builder.put(child.toSonarObject());
builder.put(child.toFlipperObject());
}
childArray = builder.build();
} else {

View File

@@ -41,7 +41,7 @@ public class NetworkFlipperPlugin extends BufferingFlipperPlugin implements Netw
.put("timestamp", requestInfo.timeStamp)
.put("method", requestInfo.method)
.put("url", requestInfo.uri)
.put("headers", toSonarObject(requestInfo.headers))
.put("headers", toFlipperObject(requestInfo.headers))
.put("data", toBase64(requestInfo.body))
.build();
@@ -64,7 +64,7 @@ public class NetworkFlipperPlugin extends BufferingFlipperPlugin implements Netw
.put("timestamp", responseInfo.timeStamp)
.put("status", responseInfo.statusCode)
.put("reason", responseInfo.statusReason)
.put("headers", toSonarObject(responseInfo.headers))
.put("headers", toFlipperObject(responseInfo.headers))
.put("data", toBase64(responseInfo.body))
.build();
@@ -99,7 +99,7 @@ public class NetworkFlipperPlugin extends BufferingFlipperPlugin implements Netw
return new String(Base64.encode(bytes, Base64.DEFAULT));
}
private FlipperArray toSonarObject(List<Header> headers) {
private FlipperArray toFlipperObject(List<Header> headers) {
final FlipperArray.Builder list = new FlipperArray.Builder();
for (Header header : headers) {