Skip to content

Commit b1c612f

Browse files
nileemaFlávio Ferreira
authored and
Flávio Ferreira
committed
Add local file connector
1 parent ee4e4b2 commit b1c612f

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
package com.facebook.presto.localfile;
15+
16+
import com.fasterxml.jackson.annotation.JsonCreator;
17+
import com.fasterxml.jackson.annotation.JsonProperty;
18+
19+
import java.util.Objects;
20+
21+
import static java.util.Objects.requireNonNull;
22+
23+
public class LocalFileConnectorId
24+
{
25+
private final String connectorId;
26+
27+
@JsonCreator
28+
public LocalFileConnectorId(@JsonProperty("connectorId") String connectorId)
29+
{
30+
this.connectorId = requireNonNull(connectorId, "connectorId is null");
31+
}
32+
33+
@JsonProperty
34+
public String getConnectorId()
35+
{
36+
return connectorId;
37+
}
38+
39+
@Override
40+
public boolean equals(Object o)
41+
{
42+
if (this == o) {
43+
return true;
44+
}
45+
if (o == null || getClass() != o.getClass()) {
46+
return false;
47+
}
48+
LocalFileConnectorId that = (LocalFileConnectorId) o;
49+
return Objects.equals(connectorId, that.connectorId);
50+
}
51+
52+
@Override
53+
public int hashCode()
54+
{
55+
return Objects.hash(connectorId);
56+
}
57+
58+
@Override
59+
public String toString()
60+
{
61+
return connectorId;
62+
}
63+
}

0 commit comments

Comments
 (0)