blob: 592bb0e754c97b9c03789b0ddf52ee2b173bb38b [file] [log] [blame]
/*
* Copyright (c) 2011 Google Inc.
*
* All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
* Public License v1.0 which accompanies this distribution, and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
package com.google.eclipse.protobuf.model.util;
import com.google.eclipse.protobuf.protobuf.*;
import com.google.inject.Singleton;
/**
* Utility methods related to fields in <code>{@link Option}</code>s
*
* @author alruiz@google.com (Alex Ruiz)
*/
@Singleton public class OptionFields {
/**
* Returns the field the given option field is referring to.
* @param field the given option field.
* @return the field the given option field is referring to, or {@code null} if one cannot be found.
*/
public IndexedElement sourceOf(OptionField field) {
return (field == null) ? null : field.getTarget();
}
}