use crate::{
java::{io::File, lang::Comparable},
JObjNew, JObjRef, JType,
};
use droid_wrap_derive::java_interface;
#[java_interface(name = "java/nio/file/Path")]
pub trait Path: JType + Comparable<Self>
where
Self: Sized,
{
fn is_absolute(&self) -> bool;
fn get_root<P: Path>(&self) -> Option<P>;
fn get_file_name<P: Path>(&self) -> Option<P>;
fn get_parent<P: Path>(&self) -> Option<P>;
fn get_name_count(&self) -> i32;
fn get_name<P: Path>(&self, index: i32) -> Result<P, <Self as JType>::Error>;
fn subpath<P: Path>(
&self,
begin_index: i32,
end_index: i32,
) -> Result<P, <Self as JType>::Error>;
fn starts_with<P: Path>(&self, other: P) -> bool;
fn starts_with_string(&self, other: String) -> Result<bool, <Self as JType>::Error>;
fn ends_with<P: Path>(&self, other: P) -> bool;
fn ends_with_string(&self, other: String) -> Result<bool, <Self as JType>::Error>;
fn normalize<P: Path>(&self) -> P;
fn resolve<P: Path>(&self, other: P) -> P;
fn resolve_string<P: Path>(&self, other: String) -> Result<P, <Self as JType>::Error>;
fn resolve_sibling<P: Path>(&self, other: P) -> P;
fn resolve_sibling_string<P: Path>(&self, other: String) -> Result<P, <Self as JType>::Error>;
fn relativize<P: Path>(&self, other: P) -> Result<P, <Self as JType>::Error>;
fn to_absolute_path<P: Path>(&self) -> Result<P, <Self as JType>::Error>;
fn to_file(&self) -> Result<File, <Self as JType>::Error>;
}