blob: fd5a5f27546d09686de3027464f3cab7f14fb5e5 [file] [log] [blame]
shahanc7667ae82018-01-11 10:10:37 -08001// Copyright 2018 The Bazel Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package com.google.devtools.build.lib.packages;
16
michajloc062b1f2018-09-10 15:53:05 -070017/** Dependencies of {@link Package} serialization. */
shahanc7667ae82018-01-11 10:10:37 -080018public interface PackageCodecDependencies {
19
20 PackageSerializerInterface getPackageSerializer();
21
shahanc7667ae82018-01-11 10:10:37 -080022 /** Simplest implementation of PackageCodecDependencies. */
23 public static class SimplePackageCodecDependencies implements PackageCodecDependencies {
24 private final PackageSerializerInterface packageSerializer;
shahanc7667ae82018-01-11 10:10:37 -080025
michajloc062b1f2018-09-10 15:53:05 -070026 public SimplePackageCodecDependencies(PackageSerializerInterface packageSerializer) {
shahanc7667ae82018-01-11 10:10:37 -080027 this.packageSerializer = packageSerializer;
shahanc7667ae82018-01-11 10:10:37 -080028 }
29
30 @Override
31 public PackageSerializerInterface getPackageSerializer() {
32 return packageSerializer;
33 }
shahanc7667ae82018-01-11 10:10:37 -080034 }
35}