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) { public Builder put(FlipperValue v) {
return put(v.toSonarObject()); return put(v.toFlipperObject());
} }
public Builder put(FlipperArray a) { public Builder put(FlipperArray a) {

View File

@@ -8,20 +8,20 @@
package com.facebook.flipper.core; 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 * to respond to calls made by the desktop application or directly send messages to the desktop
* application. * application.
*/ */
public interface FlipperConnection { 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. * parameter.
*/ */
void send(String method, FlipperObject params); 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. * parameter.
*/ */
void send(String method, FlipperArray params); void send(String method, FlipperArray params);
@@ -30,7 +30,7 @@ public interface FlipperConnection {
void reportError(Throwable throwable); 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. * FlipperReceiver is passed a responder to respond back to the desktop application.
*/ */
void receive(String method, FlipperReceiver receiver); void receive(String method, FlipperReceiver receiver);

View File

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

View File

@@ -8,16 +8,16 @@
package com.facebook.flipper.core; 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 * 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 * 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. * FlipperConnection, do not attempt to re-use the previous connection.
*/ */
public interface FlipperPlugin { 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 * methods on to route them to your plugin. This should match the id specified in your React
* plugin. * plugin.
*/ */

View File

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

View File

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

View File

@@ -8,5 +8,5 @@
package com.facebook.flipper.core; package com.facebook.flipper.core;
public interface FlipperValue { 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 boolean axEnabled = params.getBoolean("axEnabled");
final SearchResultNode matchTree = searchTree(query.toLowerCase(), mApplication, 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 = final FlipperObject response =
new FlipperObject.Builder().put("results", results).put("query", query).build(); new FlipperObject.Builder().put("results", results).put("query", query).build();
responder.success(response); responder.success(response);

View File

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

View File

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

View File

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